changeset 23090:24600c9d7f4e stable

largefiles: add examination of exec bit in "hg status --rev REV" case Before this patch, "hg status --rev REV" doesn't list largefiles up with "M" mark, even if exec bit of them is changed, because "lfilesrepo.status" doesn't examine exec bit in such case.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 28 Oct 2014 01:14:12 +0900
parents 197dc4580da2
children 8d43c6bb38c0
files hgext/largefiles/reposetup.py tests/test-largefiles-update.t
diffstat 2 files changed, 32 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/reposetup.py	Tue Oct 28 01:14:11 2014 +0900
+++ b/hgext/largefiles/reposetup.py	Tue Oct 28 01:14:12 2014 +0900
@@ -174,8 +174,11 @@
                         for lfile in tocheck:
                             standin = lfutil.standin(lfile)
                             if standin in ctx1:
-                                if ctx1[standin].data().strip() != \
-                                        lfutil.hashfile(self.wjoin(lfile)):
+                                abslfile = self.wjoin(lfile)
+                                if ((ctx1[standin].data().strip() !=
+                                     lfutil.hashfile(abslfile)) or
+                                    (('x' in ctx1.flags(standin)) !=
+                                     bool(lfutil.getexecutable(abslfile)))):
                                     modified.append(lfile)
                                 elif listclean:
                                     clean.append(lfile)
--- a/tests/test-largefiles-update.t	Tue Oct 28 01:14:11 2014 +0900
+++ b/tests/test-largefiles-update.t	Tue Oct 28 01:14:12 2014 +0900
@@ -552,4 +552,31 @@
   R largeX
   $ hg status -A --rev '.^1' largeX
 
+#if execbit
+
+Test that "hg status" against revisions other than parent notices exec
+bit changes of largefiles.
+
+  $ hg update -q -C 4
+
+(the case that large2 doesn't have exec bit in the target context but
+in the working context)
+
+  $ chmod +x large2
+  $ hg status -A --rev 0 large2
+  M large2
+  $ hg commit -m 'chmod +x large2'
+
+(the case that large2 has exec bit in the target context but not in
+the working context)
+
+  $ echo dummy > dummy
+  $ hg add dummy
+  $ hg commit -m 'revision for separation'
+  $ chmod -x large2
+  $ hg status -A --rev '.^1' large2
+  M large2
+
+#endif
+
   $ cd ..