使用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...master project projectA/ First, rewinding head to replay your work on top of it... Applying: y
尽管repo会给出上面的提示信息" manifest switched",但常常会被接下来的输出淹没掉,并且非常多时候这种行为都不是我们想要的,要想终止这个行为。能够这样改动
diff --git a/project.py b/project.py index 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