update: default to tipmost branch if default branch doesn't exist
authorMatt Mackall <mpm@selenic.com>
Sun, 02 Dec 2007 15:15:49 -0600
changeset 5570 78a6b985882f
parent 5569 9e209193f18d
child 5571 f84bb2e1cc3a
update: default to tipmost branch if default branch doesn't exist
mercurial/merge.py
--- a/mercurial/merge.py	Sun Dec 02 13:37:30 2007 -0600
+++ b/mercurial/merge.py	Sun Dec 02 15:15:49 2007 -0600
@@ -609,7 +609,10 @@
             try:
                 node = repo.branchtags()[wc.branch()]
             except KeyError:
-                raise util.Abort(_("branch %s not found") % wc.branch())
+                if wc.branch() == "default": # no default branch!
+                    node = repo.lookup("tip") # update to tip
+                else:
+                    raise util.Abort(_("branch %s not found") % wc.branch())
         overwrite = force and not branchmerge
         forcemerge = force and branchmerge
         pl = wc.parents()