[PATCH 3 of 4] clone to master, even if it is not on the default branch

arne_bab at web.de arne_bab at web.de
Fri Nov 4 04:42:08 CDT 2011


# HG changeset patch
# User Arne Babenhauserheide <bab at draketo.de>
# Date 1320399198 -3600
# Node ID b5307f7085af0d86e0b67623864c09cd70509472
# Parent  8f614fd777b7190329b9fe705b6e1f518d9193ab
clone to master, even if it is not on the default branch.

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -376,14 +376,12 @@ def clone(ui, peeropts, source, dest=Non
                     for k, n in srcrepo._bookmarks.iteritems():
                         destrepo.pushkey('bookmarks', k, '', hex(n))
 
-            # check for a master bookmark on the default branch
+            # check for a master bookmark. Clone to this even when it
+            # is not on the default branch
             try:
                 # make sure, master is a bookmark
                 master = destrepo._bookmarks['master']
                 m = destrepo['master']
-                if not m.branch() == 'default':
-                    master = None
-                print "master:", master, m
             except: master = None
 
             if update:


More information about the Mercurial-devel mailing list