Patchwork [5,of,5] trydiff: use 'ctx1.flags()' for symmetry with 'ctx2.flags()'

login
register
mail settings
Submitter Martin von Zweigbergk
Date Dec. 24, 2014, 12:44 a.m.
Message ID <2d533c714aa631e2a3eb.1419381855@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/7222/
State Accepted
Commit a90499a6ad8dbdd0480511e7c1aa302139d58b50
Headers show

Comments

Martin von Zweigbergk - Dec. 24, 2014, 12:44 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1419380186 28800
#      Tue Dec 23 16:16:26 2014 -0800
# Node ID 2d533c714aa631e2a3eb7a322e7f4105b6c3e016
# Parent  09218e2b5e5da534916698fb524567625bff9ec3
trydiff: use 'ctx1.flags()' for symmetry with 'ctx2.flags()'
Matt Mackall - Dec. 24, 2014, 7:37 p.m.
On Tue, 2014-12-23 at 16:44 -0800, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1419380186 28800
> #      Tue Dec 23 16:16:26 2014 -0800
> # Node ID 2d533c714aa631e2a3eb7a322e7f4105b6c3e016
> # Parent  09218e2b5e5da534916698fb524567625bff9ec3
> trydiff: use 'ctx1.flags()' for symmetry with 'ctx2.flags()'

Nice, queued for default.

Patch

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -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: