Pārlūkot izejas kodu

Fix 'repo sync' rebase logic on a published branch

If the current branch is published, but all published commits are
merged into the manifest revision, but there is also at least one
unpublished commit on the current branch, we should rebase the
unpublished commit, rather than creating a merge commit.

Signed-off-by: Shawn O. Pearce <sop@google.com>
Shawn O. Pearce 17 gadi atpakaļ
vecāks
revīzija
7663cb119a
1 mainītis faili ar 3 papildinājumiem un 6 dzēšanām
  1. 3 6
      project.py

+ 3 - 6
project.py

@@ -682,18 +682,15 @@ class Project(object):
                        branch.name,
                        len(upstream_gain))
         return
-      elif upstream_gain:
-        # We can fast-forward safely.
+      elif pub == head:
+        # All published commits are merged, and thus we are a
+        # strict subset.  We can fast-forward safely.
         #
         def _doff():
           self._FastForward(rev)
           self._CopyFiles()
         syncbuf.later1(self, _doff)
         return
-      else:
-        # Trivially no changes in the upstream.
-        #
-        return
 
     if merge == rev:
       try: