changeset 1156:0f53c24096c6 stable

merge
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 11 Nov 2014 11:28:01 +0000
parents 4241a5162de7 (diff) 3ad45ed74313 (current diff)
children 5951969400ce
files
diffstat 5 files changed, 129 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/README	Tue Nov 11 11:26:57 2014 +0000
+++ b/README	Tue Nov 11 11:28:01 2014 +0000
@@ -28,11 +28,9 @@
 Contribute
 ==========
 
-The simplest way to contribute is to issue a pull request on Bitbucket
-(https://bitbucket.org/marmoute/mutable-history). Alternatively, you
-can use the patchbomb extension to send email to mercurial
-devel. Please make sure to use the evolve-ext flag when doing so. You
-can use a command like this:
+Please use the patchbomb extension to send email to mercurial devel. Please
+make sure to use the evolve-ext flag when doing so. You can use a command like
+this:
 
     hg email --to mercurial-devel@selenic.com --flag evolve-ext --rev '<your patches>'
 
@@ -46,13 +44,6 @@
     cd tests
     python run-tests.py --with-hg=/path/to/hg
 
-However, some cutting-edge changes may be found in a mutable repository hosted
-by logilab before they are published.
-
-    http://hg.netv6.net/marmoute-wip/evolve/
-
-Be sure to check latest draft changeset before submitting new changesets.
-
 
 Changelog
 =========
@@ -61,6 +52,7 @@
 
 - amend: fix --logfile argument
 - evolve: preserve branch change when evolving
+- evolve: fix potential crash while solving `bumped` changesets.
 
 5.0.0 -- 2014-10-22
 
--- a/hgext/evolve.py	Tue Nov 11 11:26:57 2014 +0000
+++ b/hgext/evolve.py	Tue Nov 11 11:28:01 2014 +0000
@@ -19,6 +19,7 @@
     - improves some aspect of the early implementation in Mercurial core
 '''
 
+__version__ = '5.1.0'
 testedwith = '3.2'
 buglink = 'http://bz.selenic.com/'
 
@@ -85,7 +86,7 @@
         return oldmemfilectx(*args, **kwargs)
 else:
     raise util.Abort('Your Mercurial is too old for this version of Evolve\n'
-                     'requires version 3.2 or above')
+                     'requires version %s or above' % min(testedwith.split()))
 
 
 # This extension contains the following code
@@ -1414,7 +1415,7 @@
         files = set()
         copied = copies.pathcopies(prec, bumped)
         precmanifest = prec.manifest()
-        for key, val in bumped.manifest().iteritems():
+        for key, val in bumped.manifest().items():
             if precmanifest.pop(key, None) != val:
                 files.add(key)
         files.update(precmanifest)  # add missing files
@@ -1488,13 +1489,13 @@
                          "| `hg prune` to kill older version.")
     if other.p1() not in divergent.parents():
         raise util.Abort("parents are not common (not handled yet)",
-                    hint="| %(d)s, %(o)s are not based on the same changeset."
-                         "| With the current state of its implementation, "
+                    hint="| %(d)s, %(o)s are not based on the same changeset.\n"
+                         "| With the current state of its implementation, \n"
                          "| evolve does not work in that case.\n"
-                         "| rebase one of them next to the other and run "
+                         "| rebase one of them next to the other and run \n"
                          "| this command again.\n"
-                         "| - either: hg rebase -dest 'p1(%(d)s)' -r %(o)s"
-                         "| - or:     hg rebase -dest 'p1(%(d)s)' -r %(o)s"
+                         "| - either: hg rebase --dest 'p1(%(d)s)' -r %(o)s\n"
+                         "| - or:     hg rebase --dest 'p1(%(o)s)' -r %(d)s"
                               % {'d': divergent, 'o': other})
 
     displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})
--- a/setup.py	Tue Nov 11 11:26:57 2014 +0000
+++ b/setup.py	Tue Nov 11 11:28:01 2014 +0000
@@ -2,10 +2,21 @@
 # Credit to Augie Fackler <durin42@gmail.com>
 
 from distutils.core import setup
+from os.path import dirname, join
+
+def get_version(relpath):
+    '''Read version info from a file without importing it'''
+    for line in open(join(dirname(__file__), relpath), 'rb'):
+        # Decode to a fail-safe string for PY3
+        # (gives unicode object in PY2)
+        line = line.decode('utf8')
+        if '__version__' in line:
+          if "'" in line:
+            return line.split("'")[1]
 
 setup(
     name='hg-evolve',
-    version='5.0.0',
+    version=get_version('hgext/evolve.py'),
     author='Pierre-Yves David',
     maintainer='Pierre-Yves David',
     maintainer_email='pierre-yves.david@ens-lyon.org',
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-evolve-bumped.t	Tue Nov 11 11:28:01 2014 +0000
@@ -0,0 +1,83 @@
+  $ hg init public
+  $ cd public
+  $ echo a > a
+  $ hg commit -A -m init
+  adding a
+  $ cd ..
+
+  $ evolvepath=$(echo $(dirname $TESTDIR))/hgext/evolve.py
+  $ hg clone -U public private
+  $ cd private
+  $ cat >> .hg/hgrc <<EOF
+  > [extensions]
+  > rebase =
+  > evolve = $evolvepath
+  > [phases]
+  > publish = false
+  > EOF
+  $ cd ..
+
+  $ cp -a private alice
+  $ cp -a private bob
+
+  $ cd alice
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a >> a
+  $ hg commit -u alice -m 'modify a'
+  $ hg push ../private
+  pushing to ../private
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  $ hg log -r 'draft()'
+  changeset:   1:4d1169d82e47
+  tag:         tip
+  user:        alice
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     modify a
+  
+
+  $ cd ../bob
+  $ hg pull ../private
+  pulling from ../private
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  pull obsolescence markers
+  (run 'hg update' to get a working copy)
+  $ hg log -r 'draft()'
+  changeset:   1:4d1169d82e47
+  tag:         tip
+  user:        alice
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     modify a
+  
+  $ hg push ../public
+  pushing to ../public
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  $ hg log -r 'draft()'
+
+  $ cd ../alice
+  $ hg amend -m 'tweak a'
+  $ hg pull ../public
+  pulling from ../public
+  searching for changes
+  no changes found
+  pull obsolescence markers
+  1 new bumped changesets
+
+  $ hg evolve -a
+  recreate:[2] tweak a
+  atop:[1] modify a
+  computing new diff
+  committed as 4d1169d82e47
+  working directory is now at 4d1169d82e47
--- a/tests/test-touch.t	Tue Nov 11 11:26:57 2014 +0000
+++ b/tests/test-touch.t	Tue Nov 11 11:28:01 2014 +0000
@@ -86,3 +86,25 @@
   o  4:[0-9a-f]{12} a (re)
   
 
+check move data kept after rebase on touch:
+
+  $ touch gna1
+  $ hg commit -Am gna1
+  adding gna1
+  $ hg mv gna1 gna2
+  $ hg commit -m move
+  $ hg st -C --change=tip
+  A gna2
+    gna1
+  R gna1
+  $ hg up .^
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ hg touch
+  1 new unstable changesets
+
+  $ hg rebase -s 11 -d 12
+  $ hg st -C --change=tip
+  A gna2
+    gna1
+  R gna1