##// END OF EJS Templates
uncommit: make -D/--date and -U/--user mutually exclusive...
Matt Harbison -
r43191:46909028 default
parent child Browse files
Show More
@@ -185,10 +185,17 b' debugrevlogopts = ['
185 def resolvecommitoptions(ui, opts):
185 def resolvecommitoptions(ui, opts):
186 """modify commit options dict to handle related options
186 """modify commit options dict to handle related options
187 """
187 """
188 if opts.get('date') and opts.get('currentdate'):
189 raise error.Abort(_('--date and --currentdate are mutually '
190 'exclusive'))
191 if opts.get(b'user') and opts.get(b'currentuser'):
192 raise error.Abort(_('--user and --currentuser are mutually '
193 'exclusive'))
194
188 # N.B. this is extremely similar to setupheaderopts() in mq.py
195 # N.B. this is extremely similar to setupheaderopts() in mq.py
189 if not opts.get(b'date') and opts.get(b'currentdate'):
196 if opts.get(b'currentdate'):
190 opts[b'date'] = b'%d %d' % dateutil.makedate()
197 opts[b'date'] = b'%d %d' % dateutil.makedate()
191 if not opts.get(b'user') and opts.get(b'currentuser'):
198 if opts.get(b'currentuser'):
192 opts[b'user'] = ui.username()
199 opts[b'user'] = ui.username()
193
200
194 def ishunk(x):
201 def ishunk(x):
@@ -549,10 +549,18 b' can be uncommitted.'
549 date: Mon Jun 30 12:12:12 1980 +0000
549 date: Mon Jun 30 12:12:12 1980 +0000
550 summary: uncommit with message
550 summary: uncommit with message
551
551
552 Bad option combinations
553
554 $ hg rollback -q --config ui.rollback=True
555 $ hg uncommit -U --user 'user'
556 abort: --user and --currentuser are mutually exclusive
557 [255]
558 $ hg uncommit -D --date today
559 abort: --date and --currentdate are mutually exclusive
560 [255]
552
561
553 `uncommit <dir>` and `cd <dir> && uncommit .` behave the same...
562 `uncommit <dir>` and `cd <dir> && uncommit .` behave the same...
554
563
555 $ hg rollback -q --config ui.rollback=True
556 $ echo 2 > dir/file2.txt
564 $ echo 2 > dir/file2.txt
557 $ hg ci -Aqm 'add file2 in directory'
565 $ hg ci -Aqm 'add file2 in directory'
558 $ hg uncommit dir
566 $ hg uncommit dir
General Comments 0
You need to be logged in to leave comments. Login now