##// END OF EJS Templates
tests: introduce hghave hardlinks...
Mads Kiilerich -
r16971:8aeb2f1a default
parent child Browse files
Show More
@@ -189,6 +189,21 b' def has_symlink():'
189 except (OSError, AttributeError):
189 except (OSError, AttributeError):
190 return False
190 return False
191
191
192 def has_hardlink():
193 from mercurial import util
194 fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix)
195 os.close(fh)
196 name = tempfile.mktemp(dir='.', prefix=tempprefix)
197 try:
198 try:
199 util.oslink(fn, name)
200 os.unlink(name)
201 return True
202 except OSError:
203 return False
204 finally:
205 os.unlink(fn)
206
192 def has_tla():
207 def has_tla():
193 return matchoutput('tla --version 2>&1', r'The GNU Arch Revision')
208 return matchoutput('tla --version 2>&1', r'The GNU Arch Revision')
194
209
@@ -266,6 +281,7 b' checks = {'
266 "gettext": (has_gettext, "GNU Gettext (msgfmt)"),
281 "gettext": (has_gettext, "GNU Gettext (msgfmt)"),
267 "git": (has_git, "git command line client"),
282 "git": (has_git, "git command line client"),
268 "gpg": (has_gpg, "gpg client"),
283 "gpg": (has_gpg, "gpg client"),
284 "hardlink": (has_hardlink, "hardlinks"),
269 "icasefs": (has_icasefs, "case insensitive file system"),
285 "icasefs": (has_icasefs, "case insensitive file system"),
270 "inotify": (has_inotify, "inotify extension support"),
286 "inotify": (has_inotify, "inotify extension support"),
271 "lsprof": (has_lsprof, "python lsprof module"),
287 "lsprof": (has_lsprof, "python lsprof module"),
@@ -48,8 +48,13 b" Invalid dest '' must abort:"
48
48
49 No update, with debug option:
49 No update, with debug option:
50
50
51 #if hardlink
51 $ hg --debug clone -U . ../c
52 $ hg --debug clone -U . ../c
52 linked 8 files
53 linked 8 files
54 #else
55 $ hg --debug clone -U . ../c
56 copied 8 files
57 #endif
53 $ cd ../c
58 $ cd ../c
54 $ cat a 2>/dev/null || echo "a not present"
59 $ cat a 2>/dev/null || echo "a not present"
55 a not present
60 a not present
@@ -104,6 +104,8 b' Compare repos:'
104 [1]
104 [1]
105
105
106
106
107 #if hardlink
108
107 Test shrink-revlog:
109 Test shrink-revlog:
108 $ cd repo-a
110 $ cd repo-a
109 $ hg --config extensions.shrink="$CONTRIBDIR/shrink-revlog.py" shrink
111 $ hg --config extensions.shrink="$CONTRIBDIR/shrink-revlog.py" shrink
@@ -127,6 +129,8 b' Test shrink-revlog:'
127 1 files, 3 changesets, 3 total revisions
129 1 files, 3 changesets, 3 total revisions
128 $ cd ..
130 $ cd ..
129
131
132 #endif
133
130 Test simplemerge command:
134 Test simplemerge command:
131
135
132 $ cp "$CONTRIBDIR/simplemerge" .
136 $ cp "$CONTRIBDIR/simplemerge" .
@@ -1,3 +1,5 b''
1 $ "$TESTDIR/hghave" hardlink || exit 80
2
1 $ cat > nlinks.py <<EOF
3 $ cat > nlinks.py <<EOF
2 > import sys
4 > import sys
3 > from mercurial import util
5 > from mercurial import util
@@ -1,3 +1,5 b''
1 $ "$TESTDIR/hghave" hardlink || exit 80
2
1 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "relink=" >> $HGRCPATH
4 $ echo "relink=" >> $HGRCPATH
3
5
General Comments 0
You need to be logged in to leave comments. Login now