comparison mercurial/commands.py @ 16092:914bc95e227b

update: use normal update path with --check (issue2450) This avoids clobbering unknown files on update by not using overwrite mode.
author Matt Mackall <mpm@selenic.com>
date Thu, 09 Feb 2012 13:16:20 -0600
parents 093b75c7b44b
children 3eab42088be4
comparison
equal deleted inserted replaced
16090:e1d8218d733b 16092:914bc95e227b
5709 rev = scmutil.revsingle(repo, rev, rev).rev() 5709 rev = scmutil.revsingle(repo, rev, rev).rev()
5710 5710
5711 if check and clean: 5711 if check and clean:
5712 raise util.Abort(_("cannot specify both -c/--check and -C/--clean")) 5712 raise util.Abort(_("cannot specify both -c/--check and -C/--clean"))
5713 5713
5714 if date:
5715 if rev is not None:
5716 raise util.Abort(_("you can't specify a revision and a date"))
5717 rev = cmdutil.finddate(ui, repo, date)
5718
5714 if check: 5719 if check:
5715 # we could use dirty() but we can ignore merge and branch trivia 5720 # we could use dirty() but we can ignore merge and branch trivia
5716 c = repo[None] 5721 c = repo[None]
5717 if c.modified() or c.added() or c.removed(): 5722 if c.modified() or c.added() or c.removed():
5718 raise util.Abort(_("uncommitted local changes")) 5723 raise util.Abort(_("uncommitted local changes"))
5719 5724 if not rev:
5720 if date: 5725 rev = repo[repo[None].branch()].rev()
5721 if rev is not None: 5726
5722 raise util.Abort(_("you can't specify a revision and a date")) 5727 if clean:
5723 rev = cmdutil.finddate(ui, repo, date)
5724
5725 if clean or check:
5726 ret = hg.clean(repo, rev) 5728 ret = hg.clean(repo, rev)
5727 else: 5729 else:
5728 ret = hg.update(repo, rev) 5730 ret = hg.update(repo, rev)
5729 5731
5730 if not ret and movemarkfrom: 5732 if not ret and movemarkfrom: