Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3349)

Unified Diff: gclient_scm.py

Issue 432017: gclient: handle case for upstream has rebased (Closed)
Patch Set: Fixed some corner cases. Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index 2b3f7aa702acf5ede91064c3f4714fa1938fe5bc..d36a95bb4e1918db3af4f3819503b8b63f40ff29 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -135,13 +135,16 @@ class GitWrapper(SCMWrapper, scm.GIT):
file_list.extend([os.path.join(self.checkout_path, f) for f in files])
return
- self._Run(['remote', 'update'], redirect_stdout=False)
new_base = 'origin'
if revision:
new_base = revision
+ cur_branch = self._Run(['symbolic-ref', 'HEAD']).split('/')[-1]
+ merge_base = self._Run(['merge-base', 'HEAD', new_base])
+ self._Run(['remote', 'update'], redirect_stdout=False)
files = self._Run(['diff', new_base, '--name-only']).split()
file_list.extend([os.path.join(self.checkout_path, f) for f in files])
- self._Run(['rebase', '-v', new_base], redirect_stdout=False)
+ self._Run(['rebase', '-v', '--onto', new_base, merge_base, cur_branch],
+ redirect_stdout=False)
print "Checked out revision %s." % self.revinfo(options, (), None)
def revert(self, options, args, file_list):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698