comparison mercurial/commands.py @ 6983:5ce625983208

bisect: only complain when nothing can be done
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Wed, 03 Sep 2008 19:00:43 +0200
parents 1b15d6e7cc3c
children 6c4a08270222 e3f9feb9ab7e
comparison
equal deleted inserted replaced
6982:9fc5bf4adbcf 6983:5ce625983208
284 bad = True 284 bad = True
285 else: 285 else:
286 reset = True 286 reset = True
287 elif extra or good + bad + skip + reset > 1: 287 elif extra or good + bad + skip + reset > 1:
288 raise util.Abort(_('incompatible arguments')) 288 raise util.Abort(_('incompatible arguments'))
289 elif not (good or bad or skip or reset):
290 ui.status(_('(no action selected)\n'))
291 return
292 289
293 if reset: 290 if reset:
294 p = repo.join("bisect.state") 291 p = repo.join("bisect.state")
295 if os.path.exists(p): 292 if os.path.exists(p):
296 os.unlink(p) 293 os.unlink(p)
325 f.rename() 322 f.rename()
326 finally: 323 finally:
327 del wlock 324 del wlock
328 325
329 if not state['good'] or not state['bad']: 326 if not state['good'] or not state['bad']:
330 return 327 if (good or bad or skip or reset):
328 return
329 if not state['good']:
330 raise util.Abort(_('cannot bisect (no known good revisions)'))
331 else:
332 raise util.Abort(_('cannot bisect (no known bad revisions)'))
331 333
332 # actually bisect 334 # actually bisect
333 nodes, changesets, good = hbisect.bisect(repo.changelog, state) 335 nodes, changesets, good = hbisect.bisect(repo.changelog, state)
334 if changesets == 0: 336 if changesets == 0:
335 displayer = cmdutil.show_changeset(ui, repo, {}) 337 displayer = cmdutil.show_changeset(ui, repo, {})