[PATCH 4 of 8] convert: flatten copies in nodes that are converted into roots

Yury Sulsky yury.sulsky at gmail.com
Mon Nov 28 00:26:00 CST 2011


# HG changeset patch
# User Yury Sulsky <yury.sulsky at gmail.com>
# Date 1322459470 18000
# Node ID ca6bd3a18621286746cc7a83f23f871d49c8ed62
# Parent  e1e5acaa40e9b1025a6002b1bd493cb976678d1d
convert: flatten copies in nodes that are converted into roots

diff -r e1e5acaa40e9 -r ca6bd3a18621 hgext/convert/filtermap.py
--- a/hgext/convert/filtermap.py	Mon Nov 28 00:46:52 2011 -0500
+++ b/hgext/convert/filtermap.py	Mon Nov 28 00:51:10 2011 -0500
@@ -222,11 +222,18 @@
         self.commits[rev].parents = mparents
         self.mark_wanted(rev, parents)
         self.convertedorder.append((rev, True, None))
-        changes = self.base.getchanges(rev)
+
+        files, copies = self.base.getchanges(rev)
+
+        # Flatten copies if this is a root node
+        if copies and not mparents:
+            files = set(files)
+            files.update([(dest, rev) for dest in copies.keys()])
+            copies = {}
 
         # Clean up and return the changes for this revision
         self._discard(*parents)
-        return changes
+        return files, copies
 
     def getfile(self, name, rev):
         return self.base.getfile(name, rev)


More information about the Mercurial-devel mailing list