##// END OF EJS Templates
phabricator: account for `basectx != ctx` when calculating renames...
Matt Harbison -
r45101:022bf715 default
parent child Browse files
Show More
@@ -61,6 +61,7 b' from mercurial.thirdparty import attr'
61 from mercurial import (
61 from mercurial import (
62 cmdutil,
62 cmdutil,
63 context,
63 context,
64 copies,
64 encoding,
65 encoding,
65 error,
66 error,
66 exthelper,
67 exthelper,
@@ -859,16 +860,28 b' def addadded(pdiff, basectx, ctx, added,'
859 # additional copies we can mark them (moves get removed from removed)
860 # additional copies we can mark them (moves get removed from removed)
860 copiedchanges = {}
861 copiedchanges = {}
861 movedchanges = {}
862 movedchanges = {}
863
864 copy = {}
865 if basectx != ctx:
866 copy = copies.pathcopies(basectx.p1(), ctx)
867
862 for fname in added:
868 for fname in added:
863 fctx = ctx[fname]
869 fctx = ctx[fname]
864 oldfctx = None
870 oldfctx = None
865 pchange = phabchange(currentPath=fname)
871 pchange = phabchange(currentPath=fname)
866
872
867 filemode = gitmode[fctx.flags()]
873 filemode = gitmode[fctx.flags()]
868 renamed = fctx.renamed()
874
875 if copy:
876 originalfname = copy.get(fname, fname)
877 else:
878 originalfname = fname
879 if fctx.renamed():
880 originalfname = fctx.renamed()[0]
881
882 renamed = fname != originalfname
869
883
870 if renamed:
884 if renamed:
871 originalfname = renamed[0]
872 oldfctx = basectx.p1()[originalfname]
885 oldfctx = basectx.p1()[originalfname]
873 originalmode = gitmode[oldfctx.flags()]
886 originalmode = gitmode[oldfctx.flags()]
874 pchange.oldPath = originalfname
887 pchange.oldPath = originalfname
General Comments 0
You need to be logged in to leave comments. Login now