comparison hgext/transplant.py @ 14319:b33f3e35efb0

scmutil: move revsingle/pair/range from cmdutil This allows users at levels below the command layer to avoid import loops.
author Matt Mackall <mpm@selenic.com>
date Fri, 13 May 2011 14:06:28 -0500
parents e7ea3e38fea8
children 2d16f15da7bd
comparison
equal deleted inserted replaced
14318:1f46be4689ed 14319:b33f3e35efb0
13 map from a changeset hash to its hash in the source repository. 13 map from a changeset hash to its hash in the source repository.
14 ''' 14 '''
15 15
16 from mercurial.i18n import _ 16 from mercurial.i18n import _
17 import os, tempfile 17 import os, tempfile
18 from mercurial import bundlerepo, cmdutil, hg, merge, match 18 from mercurial import bundlerepo, hg, merge, match
19 from mercurial import patch, revlog, scmutil, util, error 19 from mercurial import patch, revlog, scmutil, util, error, cmdutil
20 from mercurial import revset, templatekw 20 from mercurial import revset, templatekw
21 21
22 cmdtable = {} 22 cmdtable = {}
23 command = cmdutil.command(cmdtable) 23 command = cmdutil.command(cmdtable)
24 24
576 return 576 return
577 577
578 tf = tp.transplantfilter(repo, source, p1) 578 tf = tp.transplantfilter(repo, source, p1)
579 if opts.get('prune'): 579 if opts.get('prune'):
580 prune = [source.lookup(r) 580 prune = [source.lookup(r)
581 for r in cmdutil.revrange(source, opts.get('prune'))] 581 for r in scmutil.revrange(source, opts.get('prune'))]
582 matchfn = lambda x: tf(x) and x not in prune 582 matchfn = lambda x: tf(x) and x not in prune
583 else: 583 else:
584 matchfn = tf 584 matchfn = tf
585 merges = map(source.lookup, opts.get('merge', ())) 585 merges = map(source.lookup, opts.get('merge', ()))
586 revmap = {} 586 revmap = {}
587 if revs: 587 if revs:
588 for r in cmdutil.revrange(source, revs): 588 for r in scmutil.revrange(source, revs):
589 revmap[int(r)] = source.lookup(r) 589 revmap[int(r)] = source.lookup(r)
590 elif opts.get('all') or not merges: 590 elif opts.get('all') or not merges:
591 if source != repo: 591 if source != repo:
592 alltransplants = incwalk(source, csets, match=matchfn) 592 alltransplants = incwalk(source, csets, match=matchfn)
593 else: 593 else: