加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Perforce Tip: how to apply my default change to the release

发布时间:2020-12-16 00:37:45 所属栏目:大数据 来源:网络整理
导读:Create the patch, p4 diff -du -db main-branch/... ~/mywork.patch Go to the work directory of release branch. cd dir-release-branch/ `p4 edit' the files I want to patch under release branch. Please note, `lsdiff' is from the package `patchu

Create the patch,

p4 diff -du -db main-branch/... > ~/mywork.patch

Go to the work directory of release branch.

cd dir-release-branch/

`p4 edit' the files I want to patch under release branch. Please note,

  • `lsdiff' is from the package `patchutils'.
  • `nosl' will strip the slashes. It's written by me.
cat ~/mywork.patch|lsdiff|nosl 5|p4 -x - edit

Patch the files and DONE!

patch -p5 < ~/mywork.patch

Here is the source code of nosl. I put it in my .bashrc

function nosl(){
  if [ -z "$1" ]; then
    echo "Usage: echo /hello/world|nosl num"
    echo "strip num leading slashes"
  else
    perl -pe "/$n=$1;while(/$n>0){ /$_=~ s/[^//]*//+//;/$n--; }"
  fi
}

BTW,you could save all the trouble of Perforce by switching to Git .

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读