changeset 17757:fec69c72e2b4

merge with durin42
author Matt Mackall <mpm@selenic.com>
date Fri, 12 Oct 2012 15:52:59 -0500
parents 92980a8dfdfe (current diff) bb6149f1db83 (diff)
children 5863f0e4cd3a
files hgext/histedit.py
diffstat 4 files changed, 77 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Wed Mar 21 16:53:39 2012 -0500
+++ b/hgext/histedit.py	Fri Oct 12 15:52:59 2012 -0500
@@ -550,21 +550,20 @@
 
 def bootstrapcontinue(ui, repo, parentctx, existing, replacemap, rules,
                       tmpnodes, created, replaced, opts):
-    currentparent, wantnull = repo.dirstate.parents()
-    # existing is the list of revisions initially considered by
-    # histedit. Here we use it to list new changesets, descendants
-    # of parentctx without an 'existing' changeset in-between. We
-    # also have to exclude 'existing' changesets which were
-    # previously dropped.
-    descendants = set(c.node() for c in
-            repo.set('(%d::) - %d', parentctx, parentctx))
-    notdropped = set(n for n in existing if n in descendants and
-            (n not in replacemap or replacemap[n] in descendants))
-    # Discover any nodes the user has added in the interim. We can
-    # miss changesets which were dropped and recreated the same.
-    newchildren = list(c.node() for c in repo.set(
-        'sort(%ln - (%ln or %ln::))', descendants, existing, notdropped))
     action, currentnode = rules.pop(0)
+    # is there any new commit between the expected parent and "."
+    #
+    # note: does not take non linear new change in account (but previous
+    #       implementation didn't used them anyway (issue3655)
+    newchildren = [c.node() for c in repo.set('(%d::.)', parentctx)]
+    if not newchildren:
+        # `parentctxnode` should match but no result. This means that
+        # currentnode is not a descendant from parentctxnode.
+        msg = _('working directory parent is not a descendant of %s')
+        hint = _('update to %s or descendant and run "hg histedit '
+                 '--continue" again') % parentctx
+        raise util.Abort(msg % parentctx, hint=hint)
+    newchildren.pop(0)  # remove parentctxnode
     if action in ('f', 'fold'):
         tmpnodes.extend(newchildren)
     else:
@@ -696,14 +695,12 @@
             return
         while new in replacemap:
             new = replacemap[new]
-        ui.note(_('histedit:  %s to %s\n') % (node.short(old),
-                                              node.short(new)))
         octx = repo[old]
         marks = octx.bookmarks()
         if marks:
-            ui.note(_('histedit:     moving bookmarks %s\n') %
-                      ', '.join(marks))
             for mark in marks:
+                ui.note(_('histedit: moving bookmarks %s from %s to %s\n')
+                        % (mark, octx, node.short(new)))
                 repo._bookmarks[mark] = new
             bookmarks.write(repo)
 
--- a/tests/test-fncache.t	Wed Mar 21 16:53:39 2012 -0500
+++ b/tests/test-fncache.t	Fri Oct 12 15:52:59 2012 -0500
@@ -117,8 +117,6 @@
   .hg/undo.dirstate
   $ cd ..
 
-#if no-windows
-
 Encoding of reserved / long paths in the store
 
   $ hg init r2
@@ -128,22 +126,46 @@
   > portablefilenames = ignore
   > EOF
 
-  $ DIR="bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL"
-  $ mkdir -p "$DIR"
-  $ echo foo > "$DIR/normal.c"
-  $ DIR="AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH"
-  $ mkdir -p "$DIR"
-  $ echo foo > "$DIR/LOREMIPSUM.TXT"
-  $ DIR="enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services"
-  $ mkdir -p "$DIR"
-  $ echo foo > "$DIR/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider"
-  $ DIR="Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother"
-  $ mkdir -p "$DIR"
-  $ echo foo > "$DIR/AndThenAnExtremelyLongFileName.txt"
-  $ DIR="12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345"
-  $ mkdir -p "$DIR"
-  $ echo foo > "$DIR/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz"
-  $ hg ci -qAm1
+  $ hg import -q --bypass - <<EOF
+  > # HG changeset patch
+  > # User test
+  > # Date 0 0
+  > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
+  > # Parent  0000000000000000000000000000000000000000
+  > 1
+  > 
+  > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
+  > @@ -0,0 +1,1 @@
+  > +foo
+  > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
+  > @@ -0,0 +1,1 @@
+  > +foo
+  > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt	
+  > @@ -0,0 +1,1 @@
+  > +foo
+  > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
+  > @@ -0,0 +1,1 @@
+  > +foo
+  > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
+  > @@ -0,0 +1,1 @@
+  > +foo
+  > EOF
+
   $ find .hg/store -name *.i  | sort
   .hg/store/00changelog.i
   .hg/store/00manifest.i
@@ -155,5 +177,4 @@
 
   $ cd ..
 
-#endif
 
--- a/tests/test-histedit-bookmark-motion.t	Wed Mar 21 16:53:39 2012 -0500
+++ b/tests/test-histedit-bookmark-motion.t	Fri Oct 12 15:52:59 2012 -0500
@@ -85,16 +85,12 @@
   > EOF
   $ hg histedit 1 --commands commands.txt --verbose | grep histedit
   histedit: Should update metadata for the following changes:
-  histedit:  055a42cdd887 to ae467701c500
-  histedit:     moving bookmarks three
-  histedit:  177f92b77385 to d36c0562f908
-  histedit:     moving bookmarks also-two, two
-  histedit:  652413bf663e to 0efacef7cb48
-  histedit:     moving bookmarks five
-  histedit:  d2ae7f538514 to cb9a9f314b8b
-  histedit:     moving bookmarks will-move-backwards
-  histedit:  e860deea161a to ae467701c500
-  histedit:     moving bookmarks four
+  histedit: moving bookmarks three from 055a42cdd887 to ae467701c500
+  histedit: moving bookmarks also-two from 177f92b77385 to d36c0562f908
+  histedit: moving bookmarks two from 177f92b77385 to d36c0562f908
+  histedit: moving bookmarks five from 652413bf663e to 0efacef7cb48
+  histedit: moving bookmarks will-move-backwards from d2ae7f538514 to cb9a9f314b8b
+  histedit: moving bookmarks four from e860deea161a to ae467701c500
   saved backup bundle to $TESTTMP/r/.hg/strip-backup/d2ae7f538514-backup.hg (glob)
   saved backup bundle to $TESTTMP/r/.hg/strip-backup/34a9919932c1-backup.hg (glob)
   $ hg log --graph
@@ -147,11 +143,9 @@
   > EOF
   $ hg histedit 1 --commands commands.txt --verbose | grep histedit
   histedit: Should update metadata for the following changes:
-  histedit:  0efacef7cb48 to 1be9c35b4cb2
-  histedit:     moving bookmarks five
-  histedit:  0efacef7cb48 to 7c044e3e33a9
-  histedit:  ae467701c500 to 1be9c35b4cb2
-  histedit:     moving bookmarks four, three
+  histedit: moving bookmarks five from 0efacef7cb48 to 1be9c35b4cb2
+  histedit: moving bookmarks four from ae467701c500 to 1be9c35b4cb2
+  histedit: moving bookmarks three from ae467701c500 to 1be9c35b4cb2
   saved backup bundle to $TESTTMP/r/.hg/strip-backup/ae467701c500-backup.hg (glob)
 
 We expect 'five' to stay at tip, since the tipmost bookmark is most
--- a/tests/test-histedit-edit.t	Wed Mar 21 16:53:39 2012 -0500
+++ b/tests/test-histedit-edit.t	Fri Oct 12 15:52:59 2012 -0500
@@ -66,6 +66,19 @@
   abort: Make changes as needed, you may commit or record as needed now.
   When you are finished, run hg histedit --continue to resume.
 
+Go at a random point and try to continue
+
+  $ hg id -n
+  3+
+  $ hg up 0
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  $ HGEDITOR='echo foobaz > ' hg histedit --continue
+  abort: working directory parent is not a descendant of 055a42cdd887
+  (update to 055a42cdd887 or descendant and run "hg histedit --continue" again)
+  [255]
+  $ hg up 3
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
 commit, then edit the revision
   $ hg ci -m 'wat'
   created new head