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 |
General Comments 0
You need to be logged in to leave comments.
Login now