Show More
@@ -112,7 +112,8 b' def _commitfiltered(repo, ctx, match, ke' | |||
|
112 | 112 | [('', 'keep', None, _('allow an empty commit after uncommiting')), |
|
113 | 113 | ('', 'allow-dirty-working-copy', False, |
|
114 | 114 | _('allow uncommit with outstanding changes')) |
|
115 |
] + commands.walkopts + commands.commitopts + commands.commitopts2 |
|
|
115 | ] + commands.walkopts + commands.commitopts + commands.commitopts2 | |
|
116 | + commands.commitopts3, | |
|
116 | 117 | _('[OPTION]... [FILE]...'), |
|
117 | 118 | helpcategory=command.CATEGORY_CHANGE_MANAGEMENT) |
|
118 | 119 | def uncommit(ui, repo, *pats, **opts): |
@@ -128,6 +129,8 b' def uncommit(ui, repo, *pats, **opts):' | |||
|
128 | 129 | """ |
|
129 | 130 | opts = pycompat.byteskwargs(opts) |
|
130 | 131 | |
|
132 | cmdutil.resolvecommitoptions(ui, opts) | |
|
133 | ||
|
131 | 134 | with repo.wlock(), repo.lock(): |
|
132 | 135 | |
|
133 | 136 | m, a, r, d = repo.status()[:4] |
@@ -100,6 +100,13 b' commitopts2 = [' | |||
|
100 | 100 | _('record the specified user as committer'), _('USER')), |
|
101 | 101 | ] |
|
102 | 102 | |
|
103 | commitopts3 = [ | |
|
104 | (b'D', b'current-date', None, | |
|
105 | _(b'record the current date as commit date')), | |
|
106 | (b'U', b'current-user', None, | |
|
107 | _(b'record the current user as committer')), | |
|
108 | ] | |
|
109 | ||
|
103 | 110 | formatteropts = [ |
|
104 | 111 | ('T', 'template', '', |
|
105 | 112 | _('display with template'), _('TEMPLATE')), |
@@ -175,6 +182,15 b' debugrevlogopts = [' | |||
|
175 | 182 | # editor text |
|
176 | 183 | _linebelow = "^HG: ------------------------ >8 ------------------------$" |
|
177 | 184 | |
|
185 | def resolvecommitoptions(ui, opts): | |
|
186 | """modify commit options dict to handle related options | |
|
187 | """ | |
|
188 | # N.B. this is extremely similar to setupheaderopts() in mq.py | |
|
189 | if not opts.get(b'date') and opts.get(b'current_date'): | |
|
190 | opts[b'date'] = b'%d %d' % dateutil.makedate() | |
|
191 | if not opts.get(b'user') and opts.get(b'current_user'): | |
|
192 | opts[b'user'] = ui.username() | |
|
193 | ||
|
178 | 194 | def ishunk(x): |
|
179 | 195 | hunkclasses = (crecordmod.uihunk, patch.recordhunk) |
|
180 | 196 | return isinstance(x, hunkclasses) |
@@ -118,6 +118,7 b' remoteopts = cmdutil.remoteopts' | |||
|
118 | 118 | walkopts = cmdutil.walkopts |
|
119 | 119 | commitopts = cmdutil.commitopts |
|
120 | 120 | commitopts2 = cmdutil.commitopts2 |
|
121 | commitopts3 = cmdutil.commitopts3 | |
|
121 | 122 | formatteropts = cmdutil.formatteropts |
|
122 | 123 | templateopts = cmdutil.templateopts |
|
123 | 124 | logopts = cmdutil.logopts |
@@ -42,6 +42,8 b' Help for uncommit' | |||
|
42 | 42 | -l --logfile FILE read commit message from file |
|
43 | 43 | -d --date DATE record the specified date as commit date |
|
44 | 44 | -u --user USER record the specified user as committer |
|
45 | -D --current-date record the current date as commit date | |
|
46 | -U --current-user record the current user as committer | |
|
45 | 47 | |
|
46 | 48 | (some details hidden, use --verbose to show complete help) |
|
47 | 49 |
General Comments 0
You need to be logged in to leave comments.
Login now