summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--project.py32
1 files changed, 20 insertions, 12 deletions
diff --git a/project.py b/project.py
index dfc20098..8e430175 100644
--- a/project.py
+++ b/project.py
@@ -1589,6 +1589,9 @@ class Project:
1589 self._FastForward(revid) 1589 self._FastForward(revid)
1590 self._CopyAndLinkFiles() 1590 self._CopyAndLinkFiles()
1591 1591
1592 def _dorebase():
1593 self._Rebase(upstream="@{upstream}")
1594
1592 def _dosubmodules(): 1595 def _dosubmodules():
1593 self._SyncSubmodules(quiet=True) 1596 self._SyncSubmodules(quiet=True)
1594 1597
@@ -1680,19 +1683,24 @@ class Project:
1680 if pub: 1683 if pub:
1681 not_merged = self._revlist(not_rev(revid), pub) 1684 not_merged = self._revlist(not_rev(revid), pub)
1682 if not_merged: 1685 if not_merged:
1683 if upstream_gain and not force_rebase: 1686 if upstream_gain:
1684 # The user has published this branch and some of those 1687 if force_rebase:
1685 # commits are not yet merged upstream. We do not want 1688 # Try to rebase local published but not merged changes
1686 # to rewrite the published commits so we punt. 1689 # on top of the upstream changes.
1687 fail( 1690 syncbuf.later1(self, _dorebase, not verbose)
1688 LocalSyncFail( 1691 else:
1689 "branch %s is published (but not merged) and is " 1692 # The user has published this branch and some of those
1690 "now %d commits behind. Fix this manually or rerun " 1693 # commits are not yet merged upstream. We do not want
1691 "with the --rebase option to force a rebase." 1694 # to rewrite the published commits so we punt.
1692 % (branch.name, len(upstream_gain)), 1695 fail(
1693 project=self.name, 1696 LocalSyncFail(
1697 "branch %s is published (but not merged) and "
1698 "is now %d commits behind. Fix this manually "
1699 "or rerun with the --rebase option to force a "
1700 "rebase." % (branch.name, len(upstream_gain)),
1701 project=self.name,
1702 )
1694 ) 1703 )
1695 )
1696 return 1704 return
1697 syncbuf.later1(self, _doff, not verbose) 1705 syncbuf.later1(self, _doff, not verbose)
1698 return 1706 return