D512: phabsend: detect patch change with larger context

quark (Jun Wu) phabricator at mercurial-scm.org
Fri Aug 25 01:15:18 UTC 2017


quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

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



To: quark, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list