Patchwork D3414: phabricator: specify some metadata compatibly with arc.

login
register
mail settings
Submitter phabricator
Date April 20, 2018, 12:18 a.m.
Message ID <c64dd30c79e17cd21d49b16432a0bcf2@localhost.localdomain>
Download mbox | patch
Permalink /patch/31202/
State Not Applicable
Headers show

Comments

phabricator - April 20, 2018, 12:18 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfb95a54ee45c: phabricator: specify some metadata compatibly with arc. (authored by tom.prince, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D3414?vs=8408&id=8416#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3414?vs=8408&id=8416

REVISION DETAIL
  https://phab.mercurial-scm.org/D3414

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS




To: tom.prince, #hg-reviewers, indygreg, durin42
Cc: durin42, mercurial-devel

Patch

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -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.