pushtree should resolve to writable URIs
authorGregory Szorc <gps@mozilla.com>
Mon, 22 Jul 2013 00:49:43 -0700
changeset 17 838e18f486db459d6e20c2ab3cb18ec07df4c042
parent 16 761f34455600006c20c9022ee30cbd69189ff420
child 18 b5059675e80e142e982cafdf601682429865c849
push id7
push usergszorc@mozilla.com
push dateMon, 22 Jul 2013 07:49:54 +0000
pushtree should resolve to writable URIs
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -207,17 +207,22 @@ def pushtree(ui, repo, tree=None, rev=No
 
     If you would like to push a non-active head, specify it with -r REV. For
     example, if you are currently on mozilla-central but wish to push inbound
     to mozilla-inbound, run `hg pushtree -r inbound/default inbound`.
     """
     if not tree:
         raise util.Abort(_('A tree must be specified.'))
 
-    return push(ui, repo, rev=rev, dest=tree)
+    tree, uri = resolve_trees_to_uris([tree], write_access=True)[0]
+
+    if not uri:
+        raise util.Abort("Don't know about tree: %s" % tree)
+
+    return push(ui, repo, rev=rev, dest=uri)
 
 
 @command('treestatus', [], _('hg treestatus [TREE] ...'))
 def treestatus(ui, *trees, **opts):
     """Show the status of the Mozilla repositories.
 
     If trees are open, it is OK to land code on them.