mercurial/commands.py
changeset 49769 f65656572e25
parent 49741 2aaa5d1e57e9
child 49771 f0e9dda408b3
equal deleted inserted replaced
49768:bcae90c53def 49769:f65656572e25
  2080 
  2080 
  2081       - amend the current commit and set the date to now::
  2081       - amend the current commit and set the date to now::
  2082 
  2082 
  2083           hg commit --amend --date now
  2083           hg commit --amend --date now
  2084     """
  2084     """
       
  2085     cmdutil.check_incompatible_arguments(opts, 'subrepos', ['amend'])
  2085     with repo.wlock(), repo.lock():
  2086     with repo.wlock(), repo.lock():
  2086         return _docommit(ui, repo, *pats, **opts)
  2087         return _docommit(ui, repo, *pats, **opts)
  2087 
  2088 
  2088 
  2089 
  2089 def _docommit(ui, repo, *pats, **opts):
  2090 def _docommit(ui, repo, *pats, **opts):
  2095         # ret can be 0 (no changes to record) or the value returned by
  2096         # ret can be 0 (no changes to record) or the value returned by
  2096         # commit(), 1 if nothing changed or None on success.
  2097         # commit(), 1 if nothing changed or None on success.
  2097         return 1 if ret == 0 else ret
  2098         return 1 if ret == 0 else ret
  2098 
  2099 
  2099     if opts.get('subrepos'):
  2100     if opts.get('subrepos'):
  2100         cmdutil.check_incompatible_arguments(opts, 'subrepos', ['amend'])
       
  2101         # Let --subrepos on the command line override config setting.
  2101         # Let --subrepos on the command line override config setting.
  2102         ui.setconfig(b'ui', b'commitsubrepos', True, b'commit')
  2102         ui.setconfig(b'ui', b'commitsubrepos', True, b'commit')
  2103 
  2103 
  2104     cmdutil.checkunfinished(repo, commit=True)
  2104     cmdutil.checkunfinished(repo, commit=True)
  2105 
  2105