Comments
Patch
@@ -69,11 +69,12 @@
from mercurial.utils import (
procutil,
)
+from mercurial.utils import (
+ procutil,
+ stringutil,
+)
cmdtable = {}
-command = registrar.command(cmdtable)
-
-colortable = {
'phabricator.action.created': 'green',
'phabricator.action.skipped': 'magenta',
'phabricator.action.updated': 'magenta',
@@ -332,9 +333,22 @@
olddiff=None, actions=None):
"""create or update a Differential Revision
- If revid is None, create a new Differential Revision, otherwise update
- revid. If parentrevid is not None, set it as a dependency.
+ params = {
+ 'diff_id': diff[r'id'],
+ 'name': 'local:commits',
+ 'data': json.dumps({
+ ctx.hex(): {
+ 'author': stringutil.person(ctx.user()),
+ 'authorEmail': stringutil.email(ctx.user()),
+ 'time': ctx.date()[0],
+ },
+ }),
+ }
+ callconduit(ctx.repo(), 'differential.setdiffproperty', params)
+def createdifferentialrevision(ctx, revid=None, parentrevid=None, oldnode=None,
+ olddiff=None, actions=None):
+ """create or update a Differential Revision
If oldnode is not None, check if the patch content (without commit message
and metadata) has changed before creating another diff.