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
This commit is contained in:
Jun Wu 2017-08-24 17:25:18 -07:00
parent 3969533711
commit edfba89554

View File

@ -274,7 +274,7 @@ def createdifferentialrevision(ctx, revid=None, parentrevid=None, oldnode=None,
"""
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: