##// END OF EJS Templates
revrange: attempt to parse old-style queries as a first pass
Matt Mackall -
r11405:bf5d88c4 default
parent child Browse files
Show More
@@ -149,14 +149,10 b' def revrange(repo, revs):'
149 149
150 150 seen, l = set(), []
151 151 for spec in revs:
152 if spec and not (
153 spec.startswith(revrangesep) or spec.endswith(revrangesep)):
154 m = revset.match(spec)
155 for r in m(repo, range(len(repo))):
156 if r not in seen:
157 l.append(r)
158 seen.update(l)
159 elif revrangesep in spec:
152 # attempt to parse old-style ranges first to deal with
153 # things like old-tag which contain query metacharacters
154 try:
155 if revrangesep in spec:
160 156 start, end = spec.split(revrangesep, 1)
161 157 start = revfix(repo, start, 0)
162 158 end = revfix(repo, end, len(repo) - 1)
@@ -166,12 +162,22 b' def revrange(repo, revs):'
166 162 continue
167 163 seen.add(rev)
168 164 l.append(rev)
169 else:
165 continue
166 elif spec in repo: # single unquoted rev
170 167 rev = revfix(repo, spec, None)
171 168 if rev in seen:
172 169 continue
173 170 seen.add(rev)
174 171 l.append(rev)
172 except error.RepoLookupError:
173 pass
174
175 # fall through to new-style queries if old-style fails
176 m = revset.match(spec)
177 for r in m(repo, range(len(repo))):
178 if r not in seen:
179 l.append(r)
180 seen.update(l)
175 181
176 182 return l
177 183
@@ -269,7 +269,7 b' diff --git a/b1 b/b1'
269 269 +postm
270 270
271 271 % log -r ""
272 abort: 00changelog.i@: ambiguous identifier!
272 hg: parse error: empty query
273 273 % log -r <some unknown node id>
274 274 abort: unknown revision '1000000000000000000000000000000000000000'!
275 275 % log -k r1
General Comments 0
You need to be logged in to leave comments. Login now