diff mercurial/patch.py @ 3066:035fd2029575

git --diff: fix traceback when getting mode change - use the manifest instead of the mode in the working dir if the diff is against two revisions - add a testcase
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Thu, 07 Sep 2006 14:12:39 +0200
parents d16b93f4a6ca
children f422c8265ae5
line wrap: on
line diff
--- a/mercurial/patch.py	Thu Sep 07 14:01:00 2006 +0200
+++ b/mercurial/patch.py	Thu Sep 07 14:12:39 2006 +0200
@@ -502,7 +502,10 @@
                     header.append('deleted file mode %s\n' % mode)
             else:
                 omode = gitmode(mmap.execf(f))
-                nmode = gitmode(util.is_exec(repo.wjoin(f), mmap.execf(f)))
+                if node2:
+                    nmode = gitmode(mmap2.execf(f))
+                else:
+                    nmode = gitmode(util.is_exec(repo.wjoin(f), mmap.execf(f)))
                 addmodehdr(header, omode, nmode)
             r = None
             if dodiff: