# HG changeset patch # User Mads Kiilerich # Date 2013-01-15 01:59:13 # Node ID ff2c89ebf5d40134c0f61f9b83acec510047c8e7 # Parent c605e12dd622d0022d72bd056530a9025c8294fd 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.) diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -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: diff --git a/tests/test-mq-strip.t b/tests/test-mq-strip.t --- a/tests/test-mq-strip.t +++ b/tests/test-mq-strip.t @@ -309,16 +309,16 @@ 2 is parent of 3, only one strip should 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