changeset 1882:b674277ea4ef stable

uncommit: don't lose copy information of remaining files (issue5403) As reported in the issue, "hg uncommit" would lose copy information of the files that remained in the commit. The problem was simply that the a dict of copies was iterated as "src, dst in copies.items()" where it should have been "dst, src ...".
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 31 Jan 2017 12:32:45 -0800
parents c3741a5adbb0
children e553fc96447d 0303bb24f673 2fbc0f52aa44
files README hgext/evolve.py tests/test-uncommit.t
diffstat 3 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/README
+++ b/README
@@ -59,6 +59,7 @@
 5.5.1 --
 
  - fix crash when trying to fold an empty revision set (issue5453)
+ - uncommit: preserve copy information of remaining files (issue5403)
 
 5.5.0 -- 2016-10-30
 
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -2687,7 +2687,7 @@
 
     # Filter copies
     copied = copies.pathcopies(target, ctx)
-    copied = dict((src, dst) for src, dst in copied.iteritems()
+    copied = dict((dst, src) for dst, src in copied.iteritems()
                   if dst in files)
     def filectxfn(repo, memctx, path, contentctx=ctx, redirect=newcontent):
         if path in redirect:
--- a/tests/test-uncommit.t
+++ b/tests/test-uncommit.t
@@ -252,6 +252,7 @@
   M j
   M o
   A aa
+    a
   A ff
     f
   A h
@@ -264,7 +265,7 @@
   R m
   R n
   $ glog --hidden
-  @  5:c706fe2c12f8@bar(draft) touncommit
+  @  5:a1d4c1ad76cc@bar(draft) touncommit
   |
   | o  4:e8db4aa611f6@bar(draft) touncommit
   |/
@@ -278,12 +279,12 @@
   
   $ hg debugobsolete
   5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 e8db4aa611f6d5706374288e6898e498f5c44098 0 (*) {'user': 'test'} (glob)
-  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 c706fe2c12f83ba5010cb60ea6af3bd1f0c2d6d3 0 (*) {'user': 'test'} (glob)
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 a1d4c1ad76cc7eb5e8a36ef52396da334b6d59c5 0 (*) {'user': 'test'} (glob)
 
 Test --all
 
   $ hg up -C 3 --hidden
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   working directory parent is obsolete!
   (use 'hg evolve' to update to its successor)
   $ hg --config extensions.purge= purge
@@ -312,7 +313,7 @@
 
   $ hg debugobsolete
   5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 e8db4aa611f6d5706374288e6898e498f5c44098 0 (*) {'user': 'test'} (glob)
-  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 c706fe2c12f83ba5010cb60ea6af3bd1f0c2d6d3 0 (*) {'user': 'test'} (glob)
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 a1d4c1ad76cc7eb5e8a36ef52396da334b6d59c5 0 (*) {'user': 'test'} (glob)
   5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 c4cbebac3751269bdf12d1466deabcc78521d272 0 (*) {'user': 'test'} (glob)
 
 Display a warning if nothing left
@@ -322,7 +323,7 @@
   (use 'hg prune .' to remove it)
   $ hg debugobsolete
   5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 e8db4aa611f6d5706374288e6898e498f5c44098 0 (*) {'user': 'test'} (glob)
-  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 c706fe2c12f83ba5010cb60ea6af3bd1f0c2d6d3 0 (*) {'user': 'test'} (glob)
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 a1d4c1ad76cc7eb5e8a36ef52396da334b6d59c5 0 (*) {'user': 'test'} (glob)
   5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 c4cbebac3751269bdf12d1466deabcc78521d272 0 (*) {'user': 'test'} (glob)
   c4cbebac3751269bdf12d1466deabcc78521d272 4f1c269eab68720f54e88ce3c1dc02b2858b6b89 0 (*) {'user': 'test'} (glob)