diff mercurial/patch.py @ 23665:a90499a6ad8d

trydiff: use 'ctx1.flags()' for symmetry with 'ctx2.flags()'
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 23 Dec 2014 16:16:26 -0800
parents 377124ba6b10
children e864353f8c6b
line wrap: on
line diff
--- a/mercurial/patch.py	Tue Dec 23 16:25:00 2014 -0800
+++ b/mercurial/patch.py	Tue Dec 23 16:16:26 2014 -0800
@@ -1785,7 +1785,6 @@
 
     date1 = util.datestr(ctx1.date())
     date2 = util.datestr(ctx2.date())
-    man1 = ctx1.manifest()
 
     gone = set()
     gitmode = {'l': '120000', 'x': '100755', '': '100644'}
@@ -1821,7 +1820,7 @@
                             a = copy[f]
                         else:
                             a = copyto[f]
-                        omode = gitmode[man1.flags(a)]
+                        omode = gitmode[ctx1.flags(a)]
                         addmodehdr(header, omode, mode)
                         if a in removedset and a not in gone:
                             op = 'rename'
@@ -1859,14 +1858,14 @@
                         dodiff = False
                     else:
                         header.append('deleted file mode %s\n' %
-                                      gitmode[man1.flags(f)])
+                                      gitmode[ctx1.flags(f)])
                         if util.binary(to):
                             dodiff = 'binary'
                 elif not to or util.binary(to):
                     # regular diffs cannot represent empty file deletion
                     losedatafn(f)
             else:
-                oflag = man1.flags(f)
+                oflag = ctx1.flags(f)
                 nflag = ctx2.flags(f)
                 binary = util.binary(to) or util.binary(tn)
                 if opts.git: