Patchwork [evolve-ext] Fix preservation of rename information on evolve (#33)

login
register
mail settings
Submitter Julien Cristau
Date April 14, 2014, 4:32 p.m.
Message ID <4f84b3307dc2defcd260.1397493132@crater1.logilab.fr>
Download mbox | patch
Permalink /patch/4339/
State Deferred
Headers show

Comments

Julien Cristau - April 14, 2014, 4:32 p.m.
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1397492195 -7200
#      Mon Apr 14 18:16:35 2014 +0200
# Branch stable
# Node ID 4f84b3307dc2defcd2600cf6ef5893d1ec61ea41
# Parent  12ed6dfa8eead0deb3b3062df1466e63c1e54640
Fix preservation of rename information on evolve (#33)

Following what rebase itself does, call duplicatecopies between
rebasenode and concludenode.

Should fix
https://bitbucket.org/marmoute/mutable-history/issue/33/evolve-command-loses-copy-metadata
Pierre-Yves David - April 14, 2014, 6:09 p.m.
On 04/14/2014 12:32 PM, Julien Cristau wrote:
> # HG changeset patch
> # User Julien Cristau <julien.cristau@logilab.fr>
> # Date 1397492195 -7200
> #      Mon Apr 14 18:16:35 2014 +0200
> # Branch stable
> # Node ID 4f84b3307dc2defcd2600cf6ef5893d1ec61ea41
> # Parent  12ed6dfa8eead0deb3b3062df1466e63c1e54640
> Fix preservation of rename information on evolve (#33)
>
> Following what rebase itself does, call duplicatecopies between
> rebasenode and concludenode.
>
> Should fix
> https://bitbucket.org/marmoute/mutable-history/issue/33/evolve-command-loses-copy-metadata

Thanks!
This have been pushed to bitbucket.
Please say hi to the rest of Logilab for me.

Patch

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -743,19 +743,19 @@  def relocate(repo, orig, dest):
         if not orig.p2().rev() == node.nullrev:
             raise util.Abort(
                 'no support for evolution merge changesets yet',
                 hint="Redo the merge a use `hg prune` to obsolete the old one")
         destbookmarks = repo.nodebookmarks(dest.node())
-        cmdutil.duplicatecopies(repo, orig.node(), dest.node())
         nodesrc = orig.node()
         destphase = repo[nodesrc].phase()
         try:
             r = rebase.rebasenode(repo, orig.node(), dest.node(),
                                   {node.nullrev: node.nullrev}, False)
             if r[-1]: #some conflict
                 raise util.Abort(
                         'unresolved merge conflicts (see hg help resolve)')
+            cmdutil.duplicatecopies(repo, orig.node(), dest.node())
             nodenew = rebase.concludenode(repo, orig.node(), dest.node(),
                                           node.nullid)
         except util.Abort, exc:
             class LocalMergeFailure(MergeFailure, exc.__class__):
                 pass
diff --git a/tests/test-evolve.t b/tests/test-evolve.t
--- a/tests/test-evolve.t
+++ b/tests/test-evolve.t
@@ -643,5 +643,30 @@  Test olog
 
   $ hg olog
   4	: add 4 - test
   5	: add 3 - test
   11	: add 1 - test
+
+
+Test evolving renames
+
+  $ hg up null
+  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
+  $ echo a > a
+  $ hg ci -Am a
+  adding a
+  created new head
+  $ echo b > b
+  $ hg ci -Am b
+  adding b
+  $ hg mv a c
+  $ hg ci -m c
+  $ hg kill .^
+  1 changesets pruned
+  1 new unstable changesets
+  $ hg stab --any
+  move:[15] c
+  atop:[13] a
+  $ hg st -C --change=tip
+  A c
+    a
+  R a