largefiles: avoid exec-bit examination on the platform being unaware of it stable
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Tue, 25 Nov 2014 18:37:28 +0900
branchstable
changeset 23383 7f8d27e1f862
parent 23381 cc0ff93d0c0c
child 23394 b5e2128ce9e6
child 23400 3bd577a3283e
largefiles: avoid exec-bit examination on the platform being unaware of it Changeset 24600c9d7f4e introduced the examination of exec bit of largefiles in "hg status --rev REV" case, but it doesn't avoid it on the platform being unaware of exec-bit (e.g. on NTFS of Windows).
hgext/largefiles/reposetup.py
tests/test-largefiles-update.t
--- a/hgext/largefiles/reposetup.py	Thu Nov 20 16:30:57 2014 -0800
+++ b/hgext/largefiles/reposetup.py	Tue Nov 25 18:37:28 2014 +0900
@@ -170,6 +170,7 @@
                     else:
                         tocheck = unsure + modified + added + clean
                         modified, added, clean = [], [], []
+                        checkexec = self.dirstate._checkexec
 
                         for lfile in tocheck:
                             standin = lfutil.standin(lfile)
@@ -177,7 +178,8 @@
                                 abslfile = self.wjoin(lfile)
                                 if ((ctx1[standin].data().strip() !=
                                      lfutil.hashfile(abslfile)) or
-                                    (('x' in ctx1.flags(standin)) !=
+                                    (checkexec and
+                                     ('x' in ctx1.flags(standin)) !=
                                      bool(lfutil.getexecutable(abslfile)))):
                                     modified.append(lfile)
                                 elif listclean:
--- a/tests/test-largefiles-update.t	Thu Nov 20 16:30:57 2014 -0800
+++ b/tests/test-largefiles-update.t	Tue Nov 25 18:37:28 2014 +0900
@@ -577,6 +577,31 @@
   $ hg status -A --rev '.^1' large2
   M large2
 
+#else
+
+Test that "hg status" against revisions other than parent ignores exec
+bit correctly on the platform being unaware of it.
+
+  $ hg update -q -C 4
+
+  $ cat > exec-bit.patch <<EOF
+  > # HG changeset patch
+  > # User test
+  > # Date 0 0
+  > #      Thu Jan 01 00:00:00 1970 +0000
+  > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90
+  > # Parent  07d6153b5c04313efb75deec9ba577de7faeb727
+  > chmod +x large2
+  > 
+  > diff --git a/.hglf/large2 b/.hglf/large2
+  > old mode 100644
+  > new mode 100755
+  > EOF
+  $ hg import --exact --bypass exec-bit.patch
+  applying exec-bit.patch
+  $ hg status -A --rev tip large2
+  C large2
+
 #endif
 
   $ cd ..