Mercurial > hg
annotate tests/test-symlink-os-yes-fs-no.py @ 8820:e8cb1fa0d4a9
test-convert-cvsnt-mergepoints: make it work on OS X.
- don't create file 'cvs' where directory 'CVS' already exists
author | Greg Ward <greg-hg@gerg.ca> |
---|---|
date | Mon, 15 Jun 2009 20:35:19 -0400 |
parents | 24fd94ed1cc0 |
children | ca6cebd8734e |
rev | line source |
---|---|
6879
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
1 import os, sys |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
2 from mercurial import hg, ui |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
3 |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
4 TESTDIR = os.environ["TESTDIR"] |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
5 |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
6 # only makes sense to test on os which supports symlinks |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
7 if not hasattr(os, "symlink"): |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
8 sys.exit(80) # SKIPPED_STATUS defined in run-tests.py |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
9 |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
10 # this is what symlink would do on a non-symlink file system |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
11 def symlink_failure(src, dst): |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
12 raise OSError, (1, "Operation not permitted") |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
13 os.symlink = symlink_failure |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
14 |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
15 # now try cloning a repo which contains symlinks |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
16 u = ui.ui() |
24fd94ed1cc0
test symlinks on symlink-capable os but non-capable filesystem (issue1149)
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
17 hg.clone(u, os.path.join(TESTDIR, 'test-no-symlinks.hg'), 'test1') |