clone: copy `.hg/bookmarks` during copy clone
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 26 Sep 2014 13:55:53 -0700
changeset 22646 d6ecdb8bfa16
parent 22645 6e431e1635b6
child 22647 5b6cd8526d56
clone: copy `.hg/bookmarks` during copy clone Now that the standard pull function includes bookmarks, we need to ensure that a copy clone also copies the bookmarks. This will let us drop the manual bookmark pulling done independently during a clone.
mercurial/hg.py
--- a/mercurial/hg.py	Fri Sep 26 17:44:00 2014 -0700
+++ b/mercurial/hg.py	Fri Sep 26 13:55:53 2014 -0700
@@ -363,6 +363,11 @@
                 raise
 
             destlock = copystore(ui, srcrepo, destpath)
+            # copy bookmarks over
+            srcbookmarks = srcrepo.join('bookmarks')
+            dstbookmarks = os.path.join(destpath, 'bookmarks')
+            if os.path.exists(srcbookmarks):
+                util.copyfile(srcbookmarks, dstbookmarks)
 
             # Recomputing branch cache might be slow on big repos,
             # so just copy it