comparison hgext/evolve.py @ 679:a8be8dfe5d99 stable

evolve: drop uneeded noderange function We can use revrange instead
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 04 Feb 2013 17:41:35 +0100
parents 718262019c6f
children 5f3121c3341c
comparison
equal deleted inserted replaced
678:718262019c6f 679:a8be8dfe5d99
666 666
667 # XXX need clean up and proper sorting in other section 667 # XXX need clean up and proper sorting in other section
668 668
669 ### util function 669 ### util function
670 ############################# 670 #############################
671
672 def noderange(repo, revsets):
673 """The same as revrange but return node"""
674 return map(repo.changelog.node,
675 scmutil.revrange(repo, revsets))
676 671
677 ### changeset rewriting logic 672 ### changeset rewriting logic
678 ############################# 673 #############################
679 674
680 def rewrite(repo, old, updates, head, newbases, commitopts): 675 def rewrite(repo, old, updates, head, newbases, commitopts):
1260 revs.extend(opts['rev']) 1255 revs.extend(opts['rev'])
1261 wlock = repo.wlock() 1256 wlock = repo.wlock()
1262 try: 1257 try:
1263 lock = repo.lock() 1258 lock = repo.lock()
1264 try: 1259 try:
1265 new = set(noderange(repo, opts['new'])) 1260 new = set(scmutil.revrange(repo, opts['new']))
1266 targetnodes = set(noderange(repo, revs)) 1261 targetnodes = set(scmutil.revrange(repo, revs))
1267 if not targetnodes: 1262 if not targetnodes:
1268 raise util.Abort('nothing to prune') 1263 raise util.Abort('nothing to prune')
1269 if new: 1264 if new:
1270 sucs = tuple(repo[n] for n in new) 1265 sucs = tuple(repo[n] for n in new)
1271 else: 1266 else: