phabsend: detect patch change with larger context
authorJun Wu <quark@fb.com>
Thu, 24 Aug 2017 17:25:18 -0700
changeset 33976 27ff2a87d8c0
parent 33975 07ffff841863
child 33977 edeb8f28c031
phabsend: detect patch change with larger context Previously phabsend has an optimization that will skip uploading a diff if the patch (with context line number = 1) remains unchanged. That could be confusing: Aug 24 15:52:28 <martinvonz> phillco: something is wrong with phabricator'your patches/ Aug 24 15:52:45 <martinvonz> ... with phabricator's view of your patches again Aug 24 15:53:38 <martinvonz> if i phabread D388 and then D399, i get a version of filemerge.py with "a, b, c" somewhere on line 344, which is not what phabricator shows for D399 Aug 24 15:53:51 <martinvonz> junw: maybe that's more for you ^ Fix that by checking context with 32767 lines, which is the same as what will be actually sent. Differential Revision: https://phab.mercurial-scm.org/D512
contrib/phabricator.py
--- a/contrib/phabricator.py	Thu Aug 24 16:52:28 2017 -0700
+++ b/contrib/phabricator.py	Thu Aug 24 17:25:18 2017 -0700
@@ -274,7 +274,7 @@
     """
     repo = ctx.repo()
     if oldnode:
-        diffopts = mdiff.diffopts(git=True, context=1)
+        diffopts = mdiff.diffopts(git=True, context=32767)
         oldctx = repo.unfiltered()[oldnode]
         neednewdiff = (getdiff(ctx, diffopts) != getdiff(oldctx, diffopts))
     else: