Mercurial > public > mercurial-scm > hg-stable
diff mercurial/phases.py @ 19984:7d5e7799a29f stable
rebase: fix rebase aborts when 'tip-1' is public (issue4082)
When aborting a rebase where tip-1 is public, rebase would fail to undo the merge
state. This caused unexpected dirstate parents and also caused unshelve to
become unabortable (since it uses rebase under the hood).
The problem was that rebase uses -2 as a marker rev, and when it checked for
immutableness during the abort, -2 got resolved to the second to last entry in
the phase cache.
Adds a test for the fix. Add exception to phase code to prevent this in the
future.
author | Durham Goode <durham@fb.com> |
---|---|
date | Mon, 04 Nov 2013 19:59:00 -0800 |
parents | d51c4d85ec23 |
children | 1716a2671ec7 |
line wrap: on
line diff
--- a/mercurial/phases.py Tue Nov 05 10:55:45 2013 +0100 +++ b/mercurial/phases.py Mon Nov 04 19:59:00 2013 -0800 @@ -185,6 +185,8 @@ # be replaced without us being notified. if rev == nullrev: return public + if rev < nullrev: + raise ValueError(_('cannot lookup negative revision')) if self._phaserevs is None or rev >= len(self._phaserevs): self._phaserevs = self.getphaserevs(repo, rebuild=True) return self._phaserevs[rev]