##// END OF EJS Templates
largefiles: use repo.store.createmode for new files in .hg/largefiles...
Martin Geisler -
r16153:05197f9f stable
parent child Browse files
Show More
@@ -237,11 +237,11 b' def copytostoreabsolute(repo, file, hash'
237 if inusercache(repo.ui, hash):
237 if inusercache(repo.ui, hash):
238 link(usercachepath(repo.ui, hash), storepath(repo, hash))
238 link(usercachepath(repo.ui, hash), storepath(repo, hash))
239 else:
239 else:
240 dst = util.atomictempfile(storepath(repo, hash))
240 dst = util.atomictempfile(storepath(repo, hash),
241 createmode=repo.store.createmode)
241 for chunk in util.filechunkiter(open(file, 'rb')):
242 for chunk in util.filechunkiter(open(file, 'rb')):
242 dst.write(chunk)
243 dst.write(chunk)
243 dst.close()
244 dst.close()
244 util.copymode(file, storepath(repo, hash))
245 linktousercache(repo, hash)
245 linktousercache(repo, hash)
246
246
247 def linktousercache(repo, hash):
247 def linktousercache(repo, hash):
@@ -1,3 +1,5 b''
1 $ "$TESTDIR/hghave" unix-permissions || exit 80
2
1 Create user cache directory
3 Create user cache directory
2
4
3 $ USERCACHE=`pwd`/cache; export USERCACHE
5 $ USERCACHE=`pwd`/cache; export USERCACHE
@@ -70,3 +72,25 b' Update working directory to tip, again.'
70 0 largefiles updated, 0 removed
72 0 largefiles updated, 0 removed
71 $ hg status
73 $ hg status
72 ! large
74 ! large
75
76 Portable way to print file permissions:
77
78 $ cd ..
79 $ cat > ls-l.py <<EOF
80 > #!/usr/bin/env python
81 > import sys, os
82 > path = sys.argv[1]
83 > print '%03o' % (os.lstat(path).st_mode & 0777)
84 > EOF
85 $ chmod +x ls-l.py
86
87 Test that files in .hg/largefiles inherit mode from .hg/store, not
88 from file in working copy:
89
90 $ cd src
91 $ chmod 750 .hg/store
92 $ chmod 660 large
93 $ echo change >> large
94 $ hg commit -m change
95 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
96 640
General Comments 0
You need to be logged in to leave comments. Login now