Show More
@@ -625,6 +625,8 b' class dirstate(object):' | |||
|
625 | 625 | dadd = deleted.append |
|
626 | 626 | cadd = clean.append |
|
627 | 627 | |
|
628 | lnkkind = stat.S_IFLNK | |
|
629 | ||
|
628 | 630 | for fn, st in self.walk(match, subrepos, listunknown, |
|
629 | 631 | listignored).iteritems(): |
|
630 | 632 | if fn not in dmap: |
@@ -640,13 +642,19 b' class dirstate(object):' | |||
|
640 | 642 | if not st and state in "nma": |
|
641 | 643 | dadd(fn) |
|
642 | 644 | elif state == 'n': |
|
645 | # The "mode & lnkkind != lnkkind or self._checklink" | |
|
646 | # lines are an expansion of "islink => checklink" | |
|
647 | # where islink means "is this a link?" and checklink | |
|
648 | # means "can we check links?". | |
|
643 | 649 | if (size >= 0 and |
|
644 | 650 | (size != st.st_size |
|
645 | 651 | or ((mode ^ st.st_mode) & 0100 and self._checkexec)) |
|
652 | and (mode & lnkkind != lnkkind or self._checklink) | |
|
646 | 653 | or size == -2 # other parent |
|
647 | 654 | or fn in self._copymap): |
|
648 | 655 | madd(fn) |
|
649 |
elif time != int(st.st_mtime) |
|
|
656 | elif (time != int(st.st_mtime) | |
|
657 | and (mode & lnkkind != lnkkind or self._checklink)): | |
|
650 | 658 | ladd(fn) |
|
651 | 659 | elif listclean: |
|
652 | 660 | cadd(fn) |
@@ -1,5 +1,5 b'' | |||
|
1 | import os, sys | |
|
2 | from mercurial import hg, ui | |
|
1 | import os, sys, time | |
|
2 | from mercurial import hg, ui, commands | |
|
3 | 3 | |
|
4 | 4 | TESTDIR = os.environ["TESTDIR"] |
|
5 | 5 | |
@@ -7,11 +7,35 b' TESTDIR = os.environ["TESTDIR"]' | |||
|
7 | 7 | if not hasattr(os, "symlink"): |
|
8 | 8 | sys.exit(80) # SKIPPED_STATUS defined in run-tests.py |
|
9 | 9 | |
|
10 | # this is what symlink would do on a non-symlink file system | |
|
10 | # clone with symlink support | |
|
11 | u = ui.ui() | |
|
12 | hg.clone(u, os.path.join(TESTDIR, 'test-no-symlinks.hg'), 'test0') | |
|
13 | ||
|
14 | repo = hg.repository(u, 'test0') | |
|
15 | ||
|
16 | # wait a bit, or the status call wont update the dirstate | |
|
17 | time.sleep(1) | |
|
18 | commands.status(u, repo) | |
|
19 | ||
|
20 | # now disable symlink support -- this is what os.symlink would do on a | |
|
21 | # non-symlink file system | |
|
11 | 22 | def symlink_failure(src, dst): |
|
12 | 23 | raise OSError, (1, "Operation not permitted") |
|
13 | 24 | os.symlink = symlink_failure |
|
14 | 25 | |
|
15 | # now try cloning a repo which contains symlinks | |
|
26 | # dereference links as if a Samba server has exported this to a | |
|
27 | # Windows client | |
|
28 | for f in 'test0/a.lnk', 'test0/d/b.lnk': | |
|
29 | os.unlink(f) | |
|
30 | fp = open(f, 'wb') | |
|
31 | fp.write(open(f[:-4]).read()) | |
|
32 | fp.close() | |
|
33 | ||
|
34 | # reload repository | |
|
35 | u = ui.ui() | |
|
36 | repo = hg.repository(u, 'test0') | |
|
37 | commands.status(u, repo) | |
|
38 | ||
|
39 | # try cloning a repo which contains symlinks | |
|
16 | 40 | u = ui.ui() |
|
17 | 41 | hg.clone(u, os.path.join(TESTDIR, 'test-no-symlinks.hg'), 'test1') |
@@ -5,3 +5,10 b' adding file changes' | |||
|
5 | 5 | added 1 changesets with 4 changes to 4 files |
|
6 | 6 | updating to branch default |
|
7 | 7 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
8 | requesting all changes | |
|
9 | adding changesets | |
|
10 | adding manifests | |
|
11 | adding file changes | |
|
12 | added 1 changesets with 4 changes to 4 files | |
|
13 | updating to branch default | |
|
14 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
General Comments 0
You need to be logged in to leave comments.
Login now