summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorMike Pontillo <pontillo@gmail.com>2012-02-28 11:53:24 -0800
committerShawn O. Pearce <sop@google.com>2012-03-12 12:24:22 -0700
commitd3153825723b2bec3476e84f2e423c646fd4c598 (patch)
tree11436435822daca2da44674fc538b3a668c199a5 /project.py
parent43bda84362b8fd8bb74a81003e8b49cff15ea5ed (diff)
downloadgit-repo-d3153825723b2bec3476e84f2e423c646fd4c598.tar.gz
Add 'rebase="false"' attribute to the <project/> XML.
This new attribute can prevent 'repo sync' from automatically rebasing. I hit a situation in where one of the git repositories I was tracking was actually an external repository that I wanted to pull commits into and merge myself. (NOT rebase, since that would lose the merge history.) In this case, I'm not using 'repo upload', I'm manually managing the merges to and from this repository. Everything was going great until I typed 'repo sync' and it rebased my manually-merged tree. Hence the option to skip it. Change-Id: I965e0dd1acb87f4a56752ebedc7e2de1c502dbf8
Diffstat (limited to 'project.py')
-rw-r--r--project.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/project.py b/project.py
index f1a931c6..60fa510a 100644
--- a/project.py
+++ b/project.py
@@ -503,7 +503,8 @@ class Project(object):
503 worktree, 503 worktree,
504 relpath, 504 relpath,
505 revisionExpr, 505 revisionExpr,
506 revisionId): 506 revisionId,
507 rebase = True):
507 self.manifest = manifest 508 self.manifest = manifest
508 self.name = name 509 self.name = name
509 self.remote = remote 510 self.remote = remote
@@ -522,6 +523,8 @@ class Project(object):
522 else: 523 else:
523 self.revisionId = revisionId 524 self.revisionId = revisionId
524 525
526 self.rebase = rebase
527
525 self.snapshots = {} 528 self.snapshots = {}
526 self.copyfiles = [] 529 self.copyfiles = []
527 self.config = GitConfig.ForRepository( 530 self.config = GitConfig.ForRepository(
@@ -1096,7 +1099,7 @@ class Project(object):
1096 branch.merge = self.revisionExpr 1099 branch.merge = self.revisionExpr
1097 branch.Save() 1100 branch.Save()
1098 1101
1099 if cnt_mine > 0: 1102 if cnt_mine > 0 and self.rebase:
1100 def _dorebase(): 1103 def _dorebase():
1101 self._Rebase(upstream = '%s^1' % last_mine, onto = revid) 1104 self._Rebase(upstream = '%s^1' % last_mine, onto = revid)
1102 self._CopyFiles() 1105 self._CopyFiles()