changeset 5570:78a6b985882f

update: default to tipmost branch if default branch doesn't exist
author Matt Mackall <mpm@selenic.com>
date Sun, 02 Dec 2007 15:15:49 -0600
parents 9e209193f18d
children f84bb2e1cc3a
files mercurial/merge.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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()