repo sync 时自动切换当前分支的remote track分支的问题

来源:互联网 发布:unity3d 5.6.2破解版 编辑:程序博客网 时间:2024/06/05 18:07

使用repo sync时,如果当前仓库有检出本地分支,假设为dev, 对应的远程track分支为origin/dev。 而manifest.xml中指定的track分支为origin/master,那么在repo sync时会自动将当前的dev分支的远程track分支修改为origin/master, 不仅如此,同时还会将origin/master上的修改rebase到本地的这个dev分支上。


projectA/: manifest switched refs/heads/dev...masterproject projectA/First, rewinding head to replay your work on top of it...Applying: y

虽然repo会给出上面的提示信息" manifest switched",但经常会被接下来的输出淹没掉,而且很多时候这样的行为都不是我们想要的,要想终止这个行为,可以这样修改

diff --git a/project.py b/project.pyindex 22e4a5d..3ce6500 100644--- a/project.py+++ b/project.py@@ -1169,6 +1169,8 @@ class Project(object):         syncbuf.info(self,                      'manifest no longer tracks %s',                      branch.merge)+      syncbuf.fail(self, "branch is not consistent:%s, %s" %(branch.merge, self.revisionExpr))  +      return      if cnt_mine < len(local_changes):       # Upstream rebased.  Not everything in HEAD


that's all

0 0
原创粉丝点击