hgext/transplant.py
changeset 48116 5ced12cfa41b
parent 47012 d55b71393907
child 48875 6000f5b25c9b
equal deleted inserted replaced
48115:b067d22dc6ad 48116:5ced12cfa41b
    35     merge,
    35     merge,
    36     patch,
    36     patch,
    37     pycompat,
    37     pycompat,
    38     registrar,
    38     registrar,
    39     revset,
    39     revset,
    40     scmutil,
       
    41     smartset,
    40     smartset,
    42     state as statemod,
    41     state as statemod,
    43     util,
    42     util,
    44     vfs as vfsmod,
    43     vfs as vfsmod,
    45 )
    44 )
   843 
   842 
   844         tf = tp.transplantfilter(repo, source, p1)
   843         tf = tp.transplantfilter(repo, source, p1)
   845         if opts.get(b'prune'):
   844         if opts.get(b'prune'):
   846             prune = {
   845             prune = {
   847                 source[r].node()
   846                 source[r].node()
   848                 for r in scmutil.revrange(source, opts.get(b'prune'))
   847                 for r in logcmdutil.revrange(source, opts.get(b'prune'))
   849             }
   848             }
   850             matchfn = lambda x: tf(x) and x not in prune
   849             matchfn = lambda x: tf(x) and x not in prune
   851         else:
   850         else:
   852             matchfn = tf
   851             matchfn = tf
   853         merges = pycompat.maplist(source.lookup, opts.get(b'merge', ()))
   852         merges = pycompat.maplist(source.lookup, opts.get(b'merge', ()))
   854         revmap = {}
   853         revmap = {}
   855         if revs:
   854         if revs:
   856             for r in scmutil.revrange(source, revs):
   855             for r in logcmdutil.revrange(source, revs):
   857                 revmap[int(r)] = source[r].node()
   856                 revmap[int(r)] = source[r].node()
   858         elif opts.get(b'all') or not merges:
   857         elif opts.get(b'all') or not merges:
   859             if source != repo:
   858             if source != repo:
   860                 alltransplants = incwalk(source, csets, match=matchfn)
   859                 alltransplants = incwalk(source, csets, match=matchfn)
   861             else:
   860             else: