##// END OF EJS Templates
rebase: define base in only place in defineparents()...
Martin von Zweigbergk -
r44695:3d2de64c default
parent child Browse files
Show More
@@ -1739,12 +1739,6 b' def defineparents(repo, rev, destmap, st'
1739 if any(p != nullrev and isancestor(rev, p) for p in newps):
1739 if any(p != nullrev and isancestor(rev, p) for p in newps):
1740 raise error.Abort(_(b'source is ancestor of destination'))
1740 raise error.Abort(_(b'source is ancestor of destination'))
1741
1741
1742 # "rebasenode" updates to new p1, use the corresponding merge base.
1743 if bases[0] != nullrev:
1744 base = bases[0]
1745 else:
1746 base = None
1747
1748 # Check if the merge will contain unwanted changes. That may happen if
1742 # Check if the merge will contain unwanted changes. That may happen if
1749 # there are multiple special (non-changelog ancestor) merge bases, which
1743 # there are multiple special (non-changelog ancestor) merge bases, which
1750 # cannot be handled well by the 3-way merge algorithm. For example:
1744 # cannot be handled well by the 3-way merge algorithm. For example:
@@ -1809,14 +1803,20 b' def defineparents(repo, rev, destmap, st'
1809 % (rev, repo[rev], unwanteddesc)
1803 % (rev, repo[rev], unwanteddesc)
1810 )
1804 )
1811
1805
1812 base = bases[i]
1813
1814 # newps[0] should match merge base if possible. Currently, if newps[i]
1806 # newps[0] should match merge base if possible. Currently, if newps[i]
1815 # is nullrev, the only case is newps[i] and newps[j] (j < i), one is
1807 # is nullrev, the only case is newps[i] and newps[j] (j < i), one is
1816 # the other's ancestor. In that case, it's fine to not swap newps here.
1808 # the other's ancestor. In that case, it's fine to not swap newps here.
1817 # (see CASE-1 and CASE-2 above)
1809 # (see CASE-1 and CASE-2 above)
1818 if i != 0 and newps[i] != nullrev:
1810 if i != 0:
1819 newps[0], newps[i] = newps[i], newps[0]
1811 if newps[i] != nullrev:
1812 newps[0], newps[i] = newps[i], newps[0]
1813 bases[0], bases[i] = bases[i], bases[0]
1814
1815 # "rebasenode" updates to new p1, use the corresponding merge base.
1816 if bases[0] != nullrev:
1817 base = bases[0]
1818 else:
1819 base = None
1820
1820
1821 repo.ui.debug(b" future parents are %d and %d\n" % tuple(newps))
1821 repo.ui.debug(b" future parents are %d and %d\n" % tuple(newps))
1822
1822
General Comments 0
You need to be logged in to leave comments. Login now