mq: stabilize update after strip of parent revision

Strip will (if it updates) update to the parent of revs[0], where revs are the
roots of the tree that is stripped.

When revs was list(set) it was thus undefined which root parent it would update
to. With sorted(set) it is at least stable what it updates to. (But it is very
possible that another more useful and predictable behaviour could be defined
... such as updating to the tip-most surviving wd ancestor.)
This commit is contained in:
Mads Kiilerich 2013-01-15 02:59:13 +01:00
parent b76126725e
commit 4f5178beb0
2 changed files with 4 additions and 4 deletions

View File

@ -3032,7 +3032,7 @@ def strip(ui, repo, *revs, **opts):
del q.applied[start:end]
q.savedirty()
revs = list(rootnodes)
revs = sorted(rootnodes)
if update and opts.get('keep'):
wlock = repo.wlock()
try:

View File

@ -309,16 +309,16 @@ after strip of merge parent
2 different branches: 2 strips
$ hg strip 2 4
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
$ hg glog
@ changeset: 2:65bd5f99a4a3
o changeset: 2:65bd5f99a4a3
| tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: d
|
o changeset: 1:ef3a871183d7
@ changeset: 1:ef3a871183d7
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: b