[PATCH 5 of 5] diff: rewrite trydiff and add index support to diff --git (issue1268)

Guillermo Perez bisho at fb.com
Wed Nov 21 11:39:47 CST 2012


I'm still a bit unsure if a combined addflagsmeta as requested for
modified, new and deleted files makes sense.

Some checks remain in trydiff to know when metadata is needed on the
patch, so addflagsmeta removes almost no complexity from the rewritten
trydiff (it's true that simplifies the old trydiff a bit).

This is the difference between current (+) with combined addflagsmeta and
the old patchset (-) with meta headers for new/delete and mode changes:

         if f in deleted:
             b = None
-            addfiledeletedmeta(meta, man1.flags(a))
         elif f in renamed:
             a = renamed[f]
             addrenamemeta(meta, a, b)
             needsmeta = True
         elif f in copied:
             a = copied[f]
             addcopymeta(meta, a, b)
             needsmeta = True
         elif f in added:
             # Added but not from rename / copy
             a = None
-            addfileaddedmeta(meta, ctx2.flags(b))
             if (ctx2.flags(b) != ''):
                 # If new file has custom flags, needs metadata
                 needsmeta = True
[…]
+        addflagsmeta(meta, fa, fb)
         if fa is not None and fb is not None and fa != fb:
             # Flags have changed
-            addflagchangemeta(meta, fa, fb)
             needsmeta = True



On 11/21/12 9:28 , "Guillermo Pérez" <bisho at fb.com> wrote:

># HG changeset patch
># User Guillermo Pérez <bisho at fb.com>
># Date 1353518802 28800
># Node ID 50969d3c17ad744822f44ff2515ef294b04fd279
># Parent  a03561228cb1d473a018f05a35b4c88f04db2c45
>diff: rewrite trydiff and add index support to diff --git (issue1268)

--
bisho at fb.com



More information about the Mercurial-devel mailing list