Show More
@@ -796,8 +796,6 b' def notutf8(fctx):' | |||||
796 | """ |
|
796 | """ | |
797 | try: |
|
797 | try: | |
798 | fctx.data().decode('utf-8') |
|
798 | fctx.data().decode('utf-8') | |
799 | if fctx.parents(): |
|
|||
800 | fctx.p1().data().decode('utf-8') |
|
|||
801 | return False |
|
799 | return False | |
802 | except UnicodeDecodeError: |
|
800 | except UnicodeDecodeError: | |
803 | fctx.repo().ui.write( |
|
801 | fctx.repo().ui.write( | |
@@ -825,6 +823,7 b' def addmodified(pdiff, ctx, modified):' | |||||
825 | """add modified files to the phabdiff""" |
|
823 | """add modified files to the phabdiff""" | |
826 | for fname in modified: |
|
824 | for fname in modified: | |
827 | fctx = ctx[fname] |
|
825 | fctx = ctx[fname] | |
|
826 | oldfctx = fctx.p1() | |||
828 | pchange = phabchange(currentPath=fname, oldPath=fname) |
|
827 | pchange = phabchange(currentPath=fname, oldPath=fname) | |
829 | filemode = gitmode[ctx[fname].flags()] |
|
828 | filemode = gitmode[ctx[fname].flags()] | |
830 | originalmode = gitmode[ctx.p1()[fname].flags()] |
|
829 | originalmode = gitmode[ctx.p1()[fname].flags()] | |
@@ -832,7 +831,7 b' def addmodified(pdiff, ctx, modified):' | |||||
832 | pchange.addoldmode(originalmode) |
|
831 | pchange.addoldmode(originalmode) | |
833 | pchange.addnewmode(filemode) |
|
832 | pchange.addnewmode(filemode) | |
834 |
|
833 | |||
835 | if fctx.isbinary() or notutf8(fctx): |
|
834 | if fctx.isbinary() or notutf8(fctx) or notutf8(oldfctx): | |
836 | makebinary(pchange, fctx) |
|
835 | makebinary(pchange, fctx) | |
837 | addoldbinary(pchange, fctx.p1(), fctx) |
|
836 | addoldbinary(pchange, fctx.p1(), fctx) | |
838 | else: |
|
837 | else: | |
@@ -849,6 +848,7 b' def addadded(pdiff, ctx, added, removed)' | |||||
849 | movedchanges = {} |
|
848 | movedchanges = {} | |
850 | for fname in added: |
|
849 | for fname in added: | |
851 | fctx = ctx[fname] |
|
850 | fctx = ctx[fname] | |
|
851 | oldfctx = None | |||
852 | pchange = phabchange(currentPath=fname) |
|
852 | pchange = phabchange(currentPath=fname) | |
853 |
|
853 | |||
854 | filemode = gitmode[ctx[fname].flags()] |
|
854 | filemode = gitmode[ctx[fname].flags()] | |
@@ -856,7 +856,8 b' def addadded(pdiff, ctx, added, removed)' | |||||
856 |
|
856 | |||
857 | if renamed: |
|
857 | if renamed: | |
858 | originalfname = renamed[0] |
|
858 | originalfname = renamed[0] | |
859 |
o |
|
859 | oldfctx = ctx.p1()[originalfname] | |
|
860 | originalmode = gitmode[oldfctx.flags()] | |||
860 | pchange.oldPath = originalfname |
|
861 | pchange.oldPath = originalfname | |
861 |
|
862 | |||
862 | if originalfname in removed: |
|
863 | if originalfname in removed: | |
@@ -891,10 +892,10 b' def addadded(pdiff, ctx, added, removed)' | |||||
891 | pchange.addnewmode(gitmode[fctx.flags()]) |
|
892 | pchange.addnewmode(gitmode[fctx.flags()]) | |
892 | pchange.type = DiffChangeType.ADD |
|
893 | pchange.type = DiffChangeType.ADD | |
893 |
|
894 | |||
894 | if fctx.isbinary() or notutf8(fctx): |
|
895 | if fctx.isbinary() or notutf8(fctx) or (oldfctx and notutf8(oldfctx)): | |
895 | makebinary(pchange, fctx) |
|
896 | makebinary(pchange, fctx) | |
896 | if renamed: |
|
897 | if renamed: | |
897 |
addoldbinary(pchange, fctx |
|
898 | addoldbinary(pchange, oldfctx, fctx) | |
898 | else: |
|
899 | else: | |
899 | maketext(pchange, ctx, fname) |
|
900 | maketext(pchange, ctx, fname) | |
900 |
|
901 |
General Comments 0
You need to be logged in to leave comments.
Login now