changeset 13745:9ff22f600c6c

convert: add bookmark support to main command During conversion, read bookmarks from source repo, filter them and push the resulting set of bookmarks to destination sink.
author Edouard Gomez <ed.gomez@free.fr>
date Wed, 07 Jul 2010 00:06:59 +0200
parents 7e525d2f9a75
children d80b768545cb
files hgext/convert/convcmd.py
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/convcmd.py	Wed Jul 07 00:06:59 2010 +0200
+++ b/hgext/convert/convcmd.py	Wed Jul 07 00:06:59 2010 +0200
@@ -378,6 +378,16 @@
                     if tagsparents:
                         self.map[tagsparents[0][0]] = nrev
 
+            bookmarks = self.source.getbookmarks()
+            cbookmarks = {}
+            for k in bookmarks:
+                v = bookmarks[k]
+                if self.map.get(v, SKIPREV) != SKIPREV:
+                    cbookmarks[k] = self.map[v]
+
+            if c and cbookmarks:
+                self.dest.putbookmarks(cbookmarks)
+
             self.writeauthormap()
         finally:
             self.cleanup()