##// END OF EJS Templates
amend: add boolean to ignore date-only change...
Yuya Nishihara -
r41159:cffa8e0b default
parent child Browse files
Show More
@@ -2442,10 +2442,12 b' def amend(ui, repo, old, extra, pats, op'
2442
2442
2443 user = opts.get('user') or old.user()
2443 user = opts.get('user') or old.user()
2444
2444
2445 datemaydiffer = False # date-only change should be ignored?
2445 if opts.get('date'):
2446 if opts.get('date'):
2446 date = dateutil.parsedate(opts.get('date'))
2447 date = dateutil.parsedate(opts.get('date'))
2447 elif ui.configbool('rewrite', 'update-timestamp'):
2448 elif ui.configbool('rewrite', 'update-timestamp'):
2448 date = dateutil.makedate()
2449 date = dateutil.makedate()
2450 datemaydiffer = True
2449 else:
2451 else:
2450 date = old.date()
2452 date = old.date()
2451
2453
@@ -2561,14 +2563,12 b' def amend(ui, repo, old, extra, pats, op'
2561 if ((not changes)
2563 if ((not changes)
2562 and newdesc == old.description()
2564 and newdesc == old.description()
2563 and user == old.user()
2565 and user == old.user()
2566 and (date == old.date() or datemaydiffer)
2564 and pureextra == old.extra()):
2567 and pureextra == old.extra()):
2565 # nothing changed. continuing here would create a new node
2568 # nothing changed. continuing here would create a new node
2566 # anyway because of the amend_source noise.
2569 # anyway because of the amend_source noise.
2567 #
2570 #
2568 # This not what we expect from amend.
2571 # This not what we expect from amend.
2569 if (date == old.date() or
2570 (ui.configbool('rewrite', 'update-timestamp') and
2571 not opts.get('date'))):
2572 return old.node()
2572 return old.node()
2573
2573
2574 commitphase = None
2574 commitphase = None
General Comments 0
You need to be logged in to leave comments. Login now