Comments
Patch
@@ -2037,6 +2037,33 @@
return commitfunc(ui, repo, message,
scmutil.match(repo[None], pats, opts), opts)
+def autocommit(commandname, repo, commitfunc, **props):
+ """create the hook point for automated committing
+
+ 'commitfunc' must be the function to create a new revision (=
+ 'localrepository.commit', 'localrepository.commitctx' or the
+ function indirectly using them). It must not cause to create
+ multiple revisions at once.
+
+ Code paths implying automated committing are expected to use the
+ function returned by 'autocommit' instead of 'commitfunc' itself.
+
+ Then, code paths extending commit behavior can hook automated
+ committing by wrapping 'autocommit'.
+
+ Below properties are allowed for 'props':
+
+ :resuming: whether the returned function is used for the 1st
+ commit of the resuming (like "rebase --continue") or
+ not. Automated committing must not use the function returned by
+ "resuming=True" for revisions other than the 1st commit of the
+ resuming.
+
+ 'commandname' may be used to identify the scope of hooking.
+ """
+
+ return commitfunc
+
def amend(ui, repo, commitfunc, old, extra, pats, opts):
ui.note(_('amending changeset %s\n') % old)
base = old.p1()