comparison hgext/rebase.py @ 13609:e035356dbfdc

rebase: don't use util.Abort for an internal error
author Martin Geisler <mg@lazybytes.net>
date Sun, 13 Mar 2011 13:52:47 +0100
parents 6bf39d88c857
children ee349e228835
comparison
equal deleted inserted replaced
13608:63ab6b0ccedc 13609:e035356dbfdc
88 srcf = opts.get('source', None) 88 srcf = opts.get('source', None)
89 basef = opts.get('base', None) 89 basef = opts.get('base', None)
90 contf = opts.get('continue') 90 contf = opts.get('continue')
91 abortf = opts.get('abort') 91 abortf = opts.get('abort')
92 collapsef = opts.get('collapse', False) 92 collapsef = opts.get('collapse', False)
93 extrafn = opts.get('extrafn') 93 extrafn = opts.get('extrafn') # internal, used by e.g. hgsubversion
94 keepf = opts.get('keep', False) 94 keepf = opts.get('keep', False)
95 keepbranchesf = opts.get('keepbranches', False) 95 keepbranchesf = opts.get('keepbranches', False)
96 detachf = opts.get('detach', False) 96 detachf = opts.get('detach', False)
97 # keepopen is not meant for use on the command line, but by 97 # keepopen is not meant for use on the command line, but by
98 # other extensions 98 # other extensions
136 if collapsef: 136 if collapsef:
137 targetancestors = set(repo.changelog.ancestors(target)) 137 targetancestors = set(repo.changelog.ancestors(target))
138 external = checkexternal(repo, state, targetancestors) 138 external = checkexternal(repo, state, targetancestors)
139 139
140 if keepbranchesf: 140 if keepbranchesf:
141 if extrafn: 141 assert not extrafn, 'cannot use both keepbranches and extrafn'
142 raise util.Abort(_('cannot use both keepbranches and extrafn'))
143 def extrafn(ctx, extra): 142 def extrafn(ctx, extra):
144 extra['branch'] = ctx.branch() 143 extra['branch'] = ctx.branch()
145 144
146 # Rebase 145 # Rebase
147 if not targetancestors: 146 if not targetancestors: