##// END OF EJS Templates
merge with stable
Matt Mackall -
r16326:b95b006e merge default
parent child Browse files
Show More
@@ -406,9 +406,10 b' class dirstate(object):'
406 # recursively normalize leading directory components
406 # recursively normalize leading directory components
407 # against dirstate
407 # against dirstate
408 if '/' in normed:
408 if '/' in normed:
409 d, f = normed.rsplit('/')
409 d, f = normed.rsplit('/', 1)
410 d = self._root + "/" + self._normalize(d, isknown)
410 d = self._normalize(d, isknown)
411 folded = d + "/" + util.fspath(f, d)
411 r = self._root + "/" + d
412 folded = d + "/" + util.fspath(f, r)
412 else:
413 else:
413 folded = util.fspath(normed, self._root)
414 folded = util.fspath(normed, self._root)
414 self._foldmap[normed] = folded
415 self._foldmap[normed] = folded
@@ -4,7 +4,7 b' if all features are there, non-zero othe'
4 prefixed with "no-", the absence of feature is tested.
4 prefixed with "no-", the absence of feature is tested.
5 """
5 """
6 import optparse
6 import optparse
7 import os
7 import os, stat
8 import re
8 import re
9 import sys
9 import sys
10 import tempfile
10 import tempfile
@@ -64,14 +64,21 b' def has_eol_in_paths():'
64 return False
64 return False
65
65
66 def has_executablebit():
66 def has_executablebit():
67 fd, path = tempfile.mkstemp(prefix=tempprefix)
68 os.close(fd)
69 try:
67 try:
70 s = os.lstat(path).st_mode
68 EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
71 os.chmod(path, s | 0100)
69 fh, fn = tempfile.mkstemp(dir=".", prefix='hg-checkexec-')
72 return (os.lstat(path).st_mode & 0100 != 0)
70 try:
73 finally:
71 os.close(fh)
74 os.remove(path)
72 m = os.stat(fn).st_mode & 0777
73 new_file_has_exec = m & EXECFLAGS
74 os.chmod(fn, m ^ EXECFLAGS)
75 exec_flags_cannot_flip = ((os.stat(fn).st_mode & 0777) == m)
76 finally:
77 os.unlink(fn)
78 except (IOError, OSError):
79 # we don't care, the user probably won't be able to commit anyway
80 return False
81 return not (new_file_has_exec or exec_flags_cannot_flip)
75
82
76 def has_icasefs():
83 def has_icasefs():
77 # Stolen from mercurial.util
84 # Stolen from mercurial.util
@@ -161,6 +168,15 b' def has_p4():'
161 return matchoutput('p4 -V', r'Rev\. P4/') and matchoutput('p4d -V', r'Rev\. P4D/')
168 return matchoutput('p4 -V', r'Rev\. P4/') and matchoutput('p4d -V', r'Rev\. P4D/')
162
169
163 def has_symlink():
170 def has_symlink():
171 if not hasattr(os, "symlink"):
172 return False
173 name = tempfile.mktemp(dir=".", prefix='hg-checklink-')
174 try:
175 os.symlink(".", name)
176 os.unlink(name)
177 return True
178 except (OSError, AttributeError):
179 return False
164 return hasattr(os, "symlink") # FIXME: should also check file system and os
180 return hasattr(os, "symlink") # FIXME: should also check file system and os
165
181
166 def has_tla():
182 def has_tla():
@@ -73,6 +73,17 b' no clobbering of untracked files with wr'
73
73
74 $ cd ..
74 $ cd ..
75
75
76 issue 3342: file in nested directory causes unexpected abort
77
78 $ hg init issue3342
79 $ cd issue3342
80
81 $ mkdir -p a/B/c/D
82 $ echo e > a/B/c/D/e
83 $ hg add a/B/c/D/e
84
85 $ cd ..
86
76 issue 3340: mq does not handle case changes correctly
87 issue 3340: mq does not handle case changes correctly
77
88
78 in addition to reported case, 'hg qrefresh' is also tested against
89 in addition to reported case, 'hg qrefresh' is also tested against
@@ -1,11 +1,12 b''
1 import os
1 import os
2 from mercurial import hg, ui
2 from mercurial import hg, ui
3 from mercurial.scmutil import walkrepos
3 from mercurial.scmutil import walkrepos
4 from mercurial.util import checklink
4 from os import mkdir, chdir
5 from os import mkdir, chdir
5 from os.path import join as pjoin
6 from os.path import join as pjoin
6
7
7 u = ui.ui()
8 u = ui.ui()
8 sym = getattr(os, 'symlink', False) and getattr(os.path, 'samestat', False)
9 sym = checklink('.')
9
10
10 hg.repository(u, 'top1', create=1)
11 hg.repository(u, 'top1', create=1)
11 mkdir('subdir')
12 mkdir('subdir')
General Comments 0
You need to be logged in to leave comments. Login now