comparison mercurial/merge.py @ 3580:41989e55fa37

allow update to switch to a different branch if the repo is clean
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sun, 29 Oct 2006 13:08:10 +0100
parents 3b4e00cba57a
children be61bd32046c fffc8a733bf9
comparison
equal deleted inserted replaced
3579:0ed2732aa393 3580:41989e55fa37
382 raise util.Abort(_("outstanding uncommitted merges")) 382 raise util.Abort(_("outstanding uncommitted merges"))
383 if pa == p1 or pa == p2: # is there a linear path from p1 to p2? 383 if pa == p1 or pa == p2: # is there a linear path from p1 to p2?
384 if branchmerge: 384 if branchmerge:
385 raise util.Abort(_("there is nothing to merge, just use " 385 raise util.Abort(_("there is nothing to merge, just use "
386 "'hg update' or look at 'hg heads'")) 386 "'hg update' or look at 'hg heads'"))
387 elif not (overwrite or branchmerge): 387 elif not branchmerge:
388 raise util.Abort(_("update spans branches, use 'hg merge' " 388 if not overwrite:
389 "or 'hg update -C' to lose changes")) 389 if wc.files():
390 raise util.Abort(_("outstanding uncommited changes, use "
391 "'hg update -C' to lose changes"))
392 else:
393 overwrite = True
390 if branchmerge and not forcemerge: 394 if branchmerge and not forcemerge:
391 if wc.modified() or wc.added() or wc.removed(): 395 if wc.modified() or wc.added() or wc.removed():
392 raise util.Abort(_("outstanding uncommitted changes")) 396 raise util.Abort(_("outstanding uncommitted changes"))
393 397
394 ### calculate phase 398 ### calculate phase