Comments
Patch
@@ -44,27 +44,21 @@ def _destcontains(node):
except subprocess.CalledProcessError:
return False
-def _thesenodesrevset(nodes):
- """Given a list of hex nodes, return a revset query that matches them all.
-
- Just here to make things a bit cleaner.
- """
- return ' + '.join(nodes)
-
# Find all accepted revisions
all_accepted = [n for n in cq.draft() if cq.accepted(n)]
+accepted_revset = ' + '.join(all_accepted)
info = json.load(os.popen("hg log -R %s -r '%s' -Tjson" % (
- conf.source, _thesenodesrevset(all_accepted))))
+ conf.source, accepted_revset)))
# dict of node: its parents.
parents = {i['node']: i['parents'] for i in info}
# Identify heads and roots of accepted revision ranges
accepted_roots = {r.strip() for r in os.popen(
"hg log -R %s -r 'roots(%s)' -T'{node}\\n'" % (
- conf.source, _thesenodesrevset(all_accepted)))}
+ conf.source, accepted_revset))}
accepted_heads = [h.strip() for h in os.popen(
"hg log -R %s -r 'heads(%s)' -T'{node}\\n'" % (
- conf.source, _thesenodesrevset(all_accepted)))]
+ conf.source, accepted_revset))]
# Condense accepted revisions down into accepted ranges
acceptrange = collections.namedtuple('acceptrange', 'roots head')
ranges = []
@@ -3,8 +3,8 @@ BUG: Fails with no accepted nodes to lan
$ land
hg: parse error: empty query
Traceback (most recent call last):
- File "/Users/kbullock/Source/Projects/hg/accept/tests/../land", line 57, in <module>
- conf.source, _thesenodesrevset(all_accepted))))
+ File "/Users/kbullock/Source/Projects/hg/accept/tests/../land", line 51, in <module>
+ conf.source, accepted_revset)))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 290, in load
**kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads