##// END OF EJS Templates
update: add --check option
Matt Mackall -
r8855:f331de88 default
parent child Browse files
Show More
@@ -2975,7 +2975,7 b' def unbundle(ui, repo, fname1, *fnames, '
2975
2975
2976 return postincoming(ui, repo, modheads, opts.get('update'), None)
2976 return postincoming(ui, repo, modheads, opts.get('update'), None)
2977
2977
2978 def update(ui, repo, node=None, rev=None, clean=False, date=None):
2978 def update(ui, repo, node=None, rev=None, clean=False, date=None, check=False):
2979 """update working directory
2979 """update working directory
2980
2980
2981 Update the repository's working directory to the specified
2981 Update the repository's working directory to the specified
@@ -2991,7 +2991,8 b' def update(ui, repo, node=None, rev=None'
2991
2991
2992 When there are uncommitted changes, use option -C/--clean to
2992 When there are uncommitted changes, use option -C/--clean to
2993 discard them, forcibly replacing the state of the working
2993 discard them, forcibly replacing the state of the working
2994 directory with the requested revision.
2994 directory with the requested revision. Alternately, use -c/--check
2995 to abort.
2995
2996
2996 When there are uncommitted changes and option -C/--clean is not
2997 When there are uncommitted changes and option -C/--clean is not
2997 used, and the parent revision and requested revision are on the
2998 used, and the parent revision and requested revision are on the
@@ -3011,6 +3012,12 b' def update(ui, repo, node=None, rev=None'
3011 if not rev:
3012 if not rev:
3012 rev = node
3013 rev = node
3013
3014
3015 if not clean and check:
3016 # we could use dirty() but we can ignore merge and branch trivia
3017 c = repo[None]
3018 if c.modified() or c.added() or c.removed():
3019 raise util.Abort(_("uncommitted local changes"))
3020
3014 if date:
3021 if date:
3015 if rev:
3022 if rev:
3016 raise util.Abort(_("you can't specify a revision and a date"))
3023 raise util.Abort(_("you can't specify a revision and a date"))
@@ -3502,6 +3509,7 b' table = {'
3502 "^update|up|checkout|co":
3509 "^update|up|checkout|co":
3503 (update,
3510 (update,
3504 [('C', 'clean', None, _('overwrite locally modified files (no backup)')),
3511 [('C', 'clean', None, _('overwrite locally modified files (no backup)')),
3512 ('c', 'check', None, _('check for uncommitted changes')),
3505 ('d', 'date', '', _('tipmost revision matching date')),
3513 ('d', 'date', '', _('tipmost revision matching date')),
3506 ('r', 'rev', '', _('revision'))],
3514 ('r', 'rev', '', _('revision'))],
3507 _('[-C] [-d DATE] [[-r] REV]')),
3515 _('[-C] [-d DATE] [[-r] REV]')),
@@ -176,7 +176,7 b' push: force, rev, ssh, remotecmd'
176 remove: after, force, include, exclude
176 remove: after, force, include, exclude
177 serve: accesslog, daemon, daemon-pipefds, errorlog, port, address, prefix, name, webdir-conf, pid-file, stdio, templates, style, ipv6, certificate
177 serve: accesslog, daemon, daemon-pipefds, errorlog, port, address, prefix, name, webdir-conf, pid-file, stdio, templates, style, ipv6, certificate
178 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, include, exclude
178 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, include, exclude
179 update: clean, date, rev
179 update: clean, check, date, rev
180 addremove: similarity, include, exclude, dry-run
180 addremove: similarity, include, exclude, dry-run
181 archive: no-decode, prefix, rev, type, include, exclude
181 archive: no-decode, prefix, rev, type, include, exclude
182 backout: merge, parent, rev, include, exclude, message, logfile, date, user
182 backout: merge, parent, rev, include, exclude, message, logfile, date, user
@@ -10,7 +10,7 b' chmod +x foo'
10 hg ci -m1
10 hg ci -m1
11 hg co -q 0
11 hg co -q 0
12 echo dirty > foo
12 echo dirty > foo
13 sleep 1
13 hg up -c
14 hg up -q
14 hg up -q
15 cat foo
15 cat foo
16 hg st -A
16 hg st -A
@@ -1,3 +1,4 b''
1 abort: uncommitted local changes
1 dirty
2 dirty
2 M foo
3 M foo
3 % validate update of standalone execute bit change
4 % validate update of standalone execute bit change
General Comments 0
You need to be logged in to leave comments. Login now