diff wrappers.py @ 278:60acc38eac96

clone: prefer tip of default to overall tip when updating
author Martijn Pieters <mj@zopatista.com>
date Fri, 24 Apr 2009 20:36:38 -0500
parents b45bae16be32
children 521d9c1bb11d
line wrap: on
line diff
--- a/wrappers.py
+++ b/wrappers.py
@@ -216,7 +216,13 @@ def clone(orig, ui, source, dest=None, *
             fp.write("default = %(url)s\nsvn = %(url)s\n" % {'url': svnurl})
             fp.close()
             if (res is None or res == 0) and not opts.get('noupdate', False):
-                commands.update(ui, repo, repo['tip'].node())
+                for test in ('default', 'tip'):
+                    try:
+                        uprev = repo.lookup(test)
+                        break
+                    except:
+                        continue
+                commands.update(ui, repo, uprev)
 
     return res