changeset 484:20e2f2dd71f1

stabilize: conflicting changeset are considered if "." if not unstable changeset are found, the current parent directory may be stabilize if conflicting
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 23 Aug 2012 14:15:36 +0200
parents b12ff7ef35b1
children 41bf6c27a122
files hgext/evolve.py tests/test-stabilize-result.t
diffstat 2 files changed, 54 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/evolve.py	Thu Aug 23 12:53:27 2012 +0200
+++ b/hgext/evolve.py	Thu Aug 23 14:15:36 2012 +0200
@@ -278,6 +278,10 @@
 def _picknexttroubled(ui, repo, any=False):
     """Pick a the next trouble changeset to solve"""
     tr = _stabilizableunstable(repo, repo['.'])
+    if tr is None:
+        wdp = repo['.']
+        if 'conflicting' in wdp.troubles():
+            tr = wdp
     if tr is None and any:
         troubled = list(repo.set('unstable()'))
         if not troubled:
@@ -286,6 +290,7 @@
             troubled = list(repo.set('conflicting()'))
         if troubled:
             tr = troubled[0]
+
     return tr
 
 
--- a/tests/test-stabilize-result.t	Thu Aug 23 12:53:27 2012 +0200
+++ b/tests/test-stabilize-result.t	Thu Aug 23 14:15:36 2012 +0200
@@ -99,6 +99,7 @@
 
 Stabilize of late comer with different parent
 ==================================================
+
 (the with same parent is handled in test-evolve.t)
 
   $ glog
@@ -170,3 +171,51 @@
   |
   o  0:07f494440405@default(public) bk:[] adda
   
+
+Stabilize of conflicting changeset with same parent
+====================================================
+
+
+  $ hg up 9
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ glog
+  o  14:1d94fef80e85@default(draft) bk:[] latecomer update to e3183e9c0961:
+  |
+  | @  9:355c5cda4de1@default(draft) bk:[] add c
+  | |
+  o |  8:e3183e9c0961@default(public) bk:[] newer a
+  |/
+  o  7:e8cc1b534401@default(public) bk:[changea] changea
+  |
+  o  0:07f494440405@default(public) bk:[] adda
+  
+  $ echo 'babar' >> a
+  $ hg amend
+  $ hg up 9
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  Working directory parent is obsolete
+  $ mv a a.old
+  $ echo 'jungle' > a
+  $ cat a.old >> a
+  $ rm a.old
+  $ hg amend
+  2 new conflictings changesets
+  $ glog
+  @  18:5d568f72d576@default(draft) bk:[] add c
+  |
+  | o  16:a311193de6c8@default(draft) bk:[] add c
+  |/
+  | o  14:1d94fef80e85@default(draft) bk:[] latecomer update to e3183e9c0961:
+  | |
+  | o  8:e3183e9c0961@default(public) bk:[] newer a
+  |/
+  o  7:e8cc1b534401@default(public) bk:[changea] changea
+  |
+  o  0:07f494440405@default(public) bk:[] adda
+  
+
+Stabilize It
+
+  $ hg stabilize
+  conflicting not handled yet
+  [4]