##// END OF EJS Templates
localrepo: convert various repo.set() users to repo.revs()
Matt Mackall -
r15404:c1eb8398 default
parent child Browse files
Show More
@@ -185,21 +185,19 b' def rebase(ui, repo, **opts):'
185 dest = repo[destf]
185 dest = repo[destf]
186
186
187 if revf:
187 if revf:
188 revgen = repo.set('%lr', revf)
188 rebaseset = repo.revs('%lr', revf)
189 elif srcf:
189 elif srcf:
190 revgen = repo.set('(%r)::', srcf)
190 rebaseset = repo.revs('(%r)::', srcf)
191 else:
191 else:
192 base = basef or '.'
192 base = basef or '.'
193 revgen = repo.set('(children(ancestor(%r, %d)) and ::(%r))::',
193 rebaseset = repo.revs('(children(ancestor(%r, %d)) & ::%r)::',
194 base, dest, base)
194 base, dest, base)
195
196 rebaseset = [c.rev() for c in revgen]
197
195
198 if not rebaseset:
196 if not rebaseset:
199 repo.ui.debug('base is ancestor of destination')
197 repo.ui.debug('base is ancestor of destination')
200 result = None
198 result = None
201 elif not keepf and list(repo.set('first(children(%ld) - %ld)',
199 elif not keepf and list(repo.revs('first(children(%ld) - %ld)',
202 rebaseset, rebaseset)):
200 rebaseset, rebaseset)):
203 raise util.Abort(
201 raise util.Abort(
204 _("can't remove original changesets with"
202 _("can't remove original changesets with"
205 " unrebased descendants"),
203 " unrebased descendants"),
@@ -582,8 +580,7 b' def buildstate(repo, dest, rebaseset, de'
582 # rebase on ancestor, force detach
580 # rebase on ancestor, force detach
583 detach = True
581 detach = True
584 if detach:
582 if detach:
585 detachset = [c.rev() for c in repo.set('::%d - ::%d - %d',
583 detachset = repo.revs('::%d - ::%d - %d', root, commonbase, root)
586 root, commonbase, root)]
587
584
588 repo.ui.debug('rebase onto %d starting from %d\n' % (dest, root))
585 repo.ui.debug('rebase onto %d starting from %d\n' % (dest, root))
589 state = dict.fromkeys(rebaseset, nullrev)
586 state = dict.fromkeys(rebaseset, nullrev)
@@ -2534,16 +2534,16 b' def graft(ui, repo, *revs, **opts):'
2534 revs = scmutil.revrange(repo, revs)
2534 revs = scmutil.revrange(repo, revs)
2535
2535
2536 # check for merges
2536 # check for merges
2537 for ctx in repo.set('%ld and merge()', revs):
2537 for rev in repo.revs('%ld and merge()', revs):
2538 ui.warn(_('skipping ungraftable merge revision %s\n') % ctx.rev())
2538 ui.warn(_('skipping ungraftable merge revision %s\n') % rev)
2539 revs.remove(ctx.rev())
2539 revs.remove(rev)
2540 if not revs:
2540 if not revs:
2541 return -1
2541 return -1
2542
2542
2543 # check for ancestors of dest branch
2543 # check for ancestors of dest branch
2544 for ctx in repo.set('::. and %ld', revs):
2544 for rev in repo.revs('::. and %ld', revs):
2545 ui.warn(_('skipping ancestor revision %s\n') % ctx.rev())
2545 ui.warn(_('skipping ancestor revision %s\n') % rev)
2546 revs.remove(ctx.rev())
2546 revs.remove(rev)
2547 if not revs:
2547 if not revs:
2548 return -1
2548 return -1
2549
2549
@@ -179,7 +179,7 b' def get(repo, status):'
179 # that's because the bisection can go either way
179 # that's because the bisection can go either way
180 range = '( bisect(bad)::bisect(good) | bisect(good)::bisect(bad) )'
180 range = '( bisect(bad)::bisect(good) | bisect(good)::bisect(bad) )'
181
181
182 _t = [c.rev() for c in repo.set('bisect(good)::bisect(bad)')]
182 _t = repo.revs('bisect(good)::bisect(bad)')
183 # The sets of topologically good or bad csets
183 # The sets of topologically good or bad csets
184 if len(_t) == 0:
184 if len(_t) == 0:
185 # Goods are topologically after bads
185 # Goods are topologically after bads
@@ -206,18 +206,17 b' def get(repo, status):'
206 ignored = '( ( (%s) | (%s) ) - (%s) )' % (iba, iga, range)
206 ignored = '( ( (%s) | (%s) ) - (%s) )' % (iba, iga, range)
207
207
208 if status == 'range':
208 if status == 'range':
209 return [c.rev() for c in repo.set(range)]
209 return repo.revs(range)
210 elif status == 'pruned':
210 elif status == 'pruned':
211 return [c.rev() for c in repo.set(pruned)]
211 return repo.revs(pruned)
212 elif status == 'untested':
212 elif status == 'untested':
213 return [c.rev() for c in repo.set(untested)]
213 return repo.revs(untested)
214 elif status == 'ignored':
214 elif status == 'ignored':
215 return [c.rev() for c in repo.set(ignored)]
215 return repo.revs(ignored)
216 elif status == "goods":
216 elif status == "goods":
217 return [c.rev() for c in repo.set(goods)]
217 return repo.revs(goods)
218 elif status == "bads":
218 elif status == "bads":
219 return [c.rev() for c in repo.set(bads)]
219 return repo.revs(bads)
220
221 else:
220 else:
222 raise error.ParseError(_('invalid bisect state'))
221 raise error.ParseError(_('invalid bisect state'))
223
222
General Comments 0
You need to be logged in to leave comments. Login now