mercurial/cmdutil.py
changeset 41120 79f8f032c706
parent 40666 69268a13ffa5
child 41123 b153a4aa06f8
equal deleted inserted replaced
41119:685cf59a134f 41120:79f8f032c706
  2441         extra.update(wctx.extra())
  2441         extra.update(wctx.extra())
  2442 
  2442 
  2443         user = opts.get('user') or old.user()
  2443         user = opts.get('user') or old.user()
  2444         date = opts.get('date') or old.date()
  2444         date = opts.get('date') or old.date()
  2445 
  2445 
       
  2446         if ui.configbool('rewrite', 'update-timestamp'):
       
  2447             if opts.get('date'):
       
  2448                 pass
       
  2449             else:
       
  2450                 date = dateutil.makedate()
       
  2451 
  2446         # Parse the date to allow comparison between date and old.date()
  2452         # Parse the date to allow comparison between date and old.date()
  2447         date = dateutil.parsedate(date)
  2453         date = dateutil.parsedate(date)
  2448 
  2454 
  2449         if len(old.parents()) > 1:
  2455         if len(old.parents()) > 1:
  2450             # ctx.files() isn't reliable for merges, so fall back to the
  2456             # ctx.files() isn't reliable for merges, so fall back to the
  2556 
  2562 
  2557         newdesc = changelog.stripdesc(new.description())
  2563         newdesc = changelog.stripdesc(new.description())
  2558         if ((not changes)
  2564         if ((not changes)
  2559             and newdesc == old.description()
  2565             and newdesc == old.description()
  2560             and user == old.user()
  2566             and user == old.user()
  2561             and date == old.date()
       
  2562             and pureextra == old.extra()):
  2567             and pureextra == old.extra()):
  2563             # nothing changed. continuing here would create a new node
  2568             # nothing changed. continuing here would create a new node
  2564             # anyway because of the amend_source noise.
  2569             # anyway because of the amend_source noise.
  2565             #
  2570             #
  2566             # This not what we expect from amend.
  2571             # This not what we expect from amend.
  2567             return old.node()
  2572             if (date == old.date() or
       
  2573                 (ui.configbool('rewrite', 'update-timestamp') and
       
  2574                  not opts.get('date'))):
       
  2575                 return old.node()
  2568 
  2576 
  2569         commitphase = None
  2577         commitphase = None
  2570         if opts.get('secret'):
  2578         if opts.get('secret'):
  2571             commitphase = phases.secret
  2579             commitphase = phases.secret
  2572         newid = repo.commitctx(new)
  2580         newid = repo.commitctx(new)