Bug 1237339 - Ignore try in cases where it doesn't make sense draft
authorNicholas Hurley <hurley@todesschaf.org>
Wed, 06 Jan 2016 10:03:09 -0800
changeset 6622 3e69b6c9e637cb3c2fe613f541fd0a99e82a559d
parent 6620 be629f390dcecf7f7f9851564bffdbc4ec3e4a2e
push id496
push userhurley@todesschaf.org
push dateWed, 06 Jan 2016 18:24:00 +0000
bugs1237339
Bug 1237339 - Ignore try in cases where it doesn't make sense
hgext/firefoxtree/__init__.py
--- a/hgext/firefoxtree/__init__.py
+++ b/hgext/firefoxtree/__init__.py
@@ -255,22 +255,24 @@ def writefirefoxtrees(repo):
         tree, uri = resolve_trees_to_uris([tag])[0]
         if not uri:
             taglines.append(line)
 
     if havedata:
         repo.vfs.write('localtags', '\n'.join(taglines))
 
 
-def get_firefoxtrees(repo):
+def get_firefoxtrees(repo, ignore_try=False):
     """Generator for Firefox tree labels defined in this repository.
 
     Returns a tuple of (tag, node, tree, uri)
     """
     for tag, node in sorted(repo.firefoxtrees.items()):
+        if ignore_try and tag == 'try':
+            continue
         result = resolve_trees_to_uris([tag])[0]
         if not result[1]:
             continue
         tree, uri = result
         yield tag, node, tree, uri
 
 
 @wireproto.wireprotocommand('firefoxtrees', '')
@@ -403,17 +405,17 @@ def updateremoterefs(repo, remote, tree)
 
 def pullcommand(orig, ui, repo, source='default', **opts):
     """Wraps built-in pull command to expand special aliases."""
     if not isfirefoxrepo(repo):
         return orig(ui, repo, source=source, **opts)
 
     # The special source "fxtrees" will pull all trees we've pulled before.
     if source == 'fxtrees':
-        for tag, node, tree, uri in get_firefoxtrees(repo):
+        for tag, node, tree, uri in get_firefoxtrees(repo, ignore_try=True):
             res = orig(ui, repo, source=tree, **opts)
             if res:
                 return res
 
         return 0
     elif source in MULTI_TREE_ALIASES:
         for tree, uri in resolve_trees_to_uris([source]):
             res = orig(ui, repo, source=tree, **opts)
@@ -470,32 +472,32 @@ def fxheads(ui, repo, **opts):
     The displayed list may be out of date. Pull before running to ensure
     data is current.
     """
     if not isfirefoxrepo(repo):
         raise util.Abort(_('fxheads is only available on Firefox repos'))
 
     displayer = cmdutil.show_changeset(ui, repo, opts)
     seen = set()
-    for tag, node, tree, uri in get_firefoxtrees(repo):
+    for tag, node, tree, uri in get_firefoxtrees(repo, ignore_try=True):
         if node in seen:
             continue
         seen.add(node)
         ctx = repo[node]
         displayer.show(ctx)
 
     displayer.close()
 
 def fxheadsrevset(repo, subset, x):
     """``fxheads()``
     Last known head commits of pulled Firefox trees.
     """
     revset.getargs(x, 0, 0, _("fxheads takes no arguments"))
     r = revset.baseset(repo[node].rev()
-                       for t, node, tr, u in get_firefoxtrees(repo))
+                       for t, node, tr, u in get_firefoxtrees(repo, ignore_try=True))
     return r & subset
 
 
 def _getcachedlabels(repo, ctx, cache):
     labels = cache.get('fxheads', None)
     if labels is None:
         if isfirefoxrepo(repo):
             labels = list(get_firefoxtrees(repo))