Show More
@@ -138,7 +138,7 b' class gnuarch_source(converter_source, c' | |||
|
138 | 138 | raise util.Abort(_('internal calling inconsistency')) |
|
139 | 139 | |
|
140 | 140 | # Raise IOError if necessary (i.e. deleted files). |
|
141 | if not os.path.exists(os.path.join(self.tmppath, name)): | |
|
141 | if not os.path.lexists(os.path.join(self.tmppath, name)): | |
|
142 | 142 | raise IOError |
|
143 | 143 | |
|
144 | 144 | return self._getfile(name, rev) |
@@ -1037,7 +1037,7 b' class svn_sink(converter_sink, commandli' | |||
|
1037 | 1037 | # our copyfile method expects to record a copy that has |
|
1038 | 1038 | # already occurred. Cross the semantic gap. |
|
1039 | 1039 | wdest = self.wjoin(dest) |
|
1040 | exists = os.path.exists(wdest) | |
|
1040 | exists = os.path.lexists(wdest) | |
|
1041 | 1041 | if exists: |
|
1042 | 1042 | fd, tempname = tempfile.mkstemp( |
|
1043 | 1043 | prefix='hg-copy-', dir=os.path.dirname(wdest)) |
@@ -674,7 +674,7 b' class queue(object):' | |||
|
674 | 674 | removed = [] |
|
675 | 675 | merged = [] |
|
676 | 676 | for f in files: |
|
677 | if os.path.exists(repo.wjoin(f)): | |
|
677 | if os.path.lexists(repo.wjoin(f)): | |
|
678 | 678 | merged.append(f) |
|
679 | 679 | else: |
|
680 | 680 | removed.append(f) |
@@ -422,7 +422,7 b' def copy(ui, repo, pats, opts, rename=Fa' | |||
|
422 | 422 | return |
|
423 | 423 | |
|
424 | 424 | # check for overwrites |
|
425 | exists = os.path.exists(target) | |
|
425 | exists = os.path.lexists(target) | |
|
426 | 426 | if not after and exists or after and state in 'mn': |
|
427 | 427 | if not opts['force']: |
|
428 | 428 | ui.warn(_('%s: not overwriting - file exists\n') % |
@@ -825,7 +825,7 b' class workingctx(changectx):' | |||
|
825 | 825 | wlock = self._repo.wlock() |
|
826 | 826 | try: |
|
827 | 827 | for f in list: |
|
828 | if unlink and os.path.exists(self._repo.wjoin(f)): | |
|
828 | if unlink and os.path.lexists(self._repo.wjoin(f)): | |
|
829 | 829 | self._repo.ui.warn(_("%s still exists!\n") % f) |
|
830 | 830 | elif self._repo.dirstate[f] == 'a': |
|
831 | 831 | self._repo.dirstate.forget(f) |
@@ -853,7 +853,7 b' class workingctx(changectx):' | |||
|
853 | 853 | |
|
854 | 854 | def copy(self, source, dest): |
|
855 | 855 | p = self._repo.wjoin(dest) |
|
856 |
if not |
|
|
856 | if not os.path.lexists(p): | |
|
857 | 857 | self._repo.ui.warn(_("%s does not exist!\n") % dest) |
|
858 | 858 | elif not (os.path.isfile(p) or os.path.islink(p)): |
|
859 | 859 | self._repo.ui.warn(_("copy failed: %s is not a file or a " |
@@ -362,7 +362,7 b' class dirstate(object):' | |||
|
362 | 362 | norm_path = os.path.normcase(path) |
|
363 | 363 | fold_path = self._foldmap.get(norm_path, None) |
|
364 | 364 | if fold_path is None: |
|
365 | if knownpath or not os.path.exists(os.path.join(self._root, path)): | |
|
365 | if knownpath or not os.path.lexists(os.path.join(self._root, path)): | |
|
366 | 366 | fold_path = path |
|
367 | 367 | else: |
|
368 | 368 | fold_path = self._foldmap.setdefault(norm_path, |
@@ -25,7 +25,7 b' class NoHunks(PatchError):' | |||
|
25 | 25 | |
|
26 | 26 | def copyfile(src, dst, basedir): |
|
27 | 27 | abssrc, absdst = [util.canonpath(basedir, basedir, x) for x in [src, dst]] |
|
28 | if os.path.exists(absdst): | |
|
28 | if os.path.lexists(absdst): | |
|
29 | 29 | raise util.Abort(_("cannot create %s: destination already exists") % |
|
30 | 30 | dst) |
|
31 | 31 | |
@@ -923,7 +923,7 b' def selectfile(afile_orig, bfile_orig, h' | |||
|
923 | 923 | if afile == bfile: |
|
924 | 924 | goodb = gooda |
|
925 | 925 | else: |
|
926 | goodb = not nullb and os.path.exists(bfile) | |
|
926 | goodb = not nullb and os.path.lexists(bfile) | |
|
927 | 927 | createfunc = hunk.createfile |
|
928 | 928 | missing = not goodb and not gooda and not createfunc() |
|
929 | 929 |
@@ -644,7 +644,7 b' def fspath(name, root):' | |||
|
644 | 644 | l = l + 1 |
|
645 | 645 | name = name[l:] |
|
646 | 646 | |
|
647 | if not os.path.exists(os.path.join(root, name)): | |
|
647 | if not os.path.lexists(os.path.join(root, name)): | |
|
648 | 648 | return None |
|
649 | 649 | |
|
650 | 650 | seps = os.sep |
@@ -29,6 +29,7 b' hg init a' | |||
|
29 | 29 | echo a > a/a |
|
30 | 30 | mkdir -p a/d1/d2 |
|
31 | 31 | echo b > a/d1/d2/b |
|
32 | ln -s a/missing a/link | |
|
32 | 33 | echo % add |
|
33 | 34 | hg --cwd a ci -d '0 0' -A -m 'add a file' |
|
34 | 35 | |
@@ -43,6 +44,7 b' ls a a-hg-wc' | |||
|
43 | 44 | cmp a/a a-hg-wc/a && echo same || echo different |
|
44 | 45 | |
|
45 | 46 | hg --cwd a mv a b |
|
47 | hg --cwd a mv link newlink | |
|
46 | 48 | echo % rename |
|
47 | 49 | hg --cwd a ci -d '2 0' -m 'rename a file' |
|
48 | 50 | hg --cwd a tip -q |
@@ -1,8 +1,9 b'' | |||
|
1 | 1 | % add |
|
2 | 2 | adding a |
|
3 | 3 | adding d1/d2/b |
|
4 | adding link | |
|
4 | 5 | % modify |
|
5 | 1:e0e2b8a9156b | |
|
6 | 1:8231f652da37 | |
|
6 | 7 | assuming destination a-hg |
|
7 | 8 | initializing svn repository 'a-hg' |
|
8 | 9 | initializing svn working copy 'a-hg-wc' |
@@ -17,6 +18,7 b' At revision 2.' | |||
|
17 | 18 | 2 1 test d1 |
|
18 | 19 | 2 1 test d1/d2 |
|
19 | 20 | 2 1 test d1/d2/b |
|
21 | 2 1 test link | |
|
20 | 22 | <?xml version="1.0"?> |
|
21 | 23 | <log> |
|
22 | 24 | <logentry |
@@ -42,6 +44,8 b' At revision 2.' | |||
|
42 | 44 | action="A">/d1/d2</path> |
|
43 | 45 | <path |
|
44 | 46 | action="A">/d1/d2/b</path> |
|
47 | <path | |
|
48 | action="A">/link</path> | |
|
45 | 49 | </paths> |
|
46 | 50 | <msg>add a file</msg> |
|
47 | 51 | </logentry> |
@@ -49,13 +53,15 b' At revision 2.' | |||
|
49 | 53 | a: |
|
50 | 54 | a |
|
51 | 55 | d1 |
|
56 | link | |
|
52 | 57 | |
|
53 | 58 | a-hg-wc: |
|
54 | 59 | a |
|
55 | 60 | d1 |
|
61 | link | |
|
56 | 62 | same |
|
57 | 63 | % rename |
|
58 | 2:eb5169441d43 | |
|
64 | 2:a67e26ccec09 | |
|
59 | 65 | assuming destination a-hg |
|
60 | 66 | initializing svn working copy 'a-hg-wc' |
|
61 | 67 | scanning source... |
@@ -68,6 +74,7 b' At revision 3.' | |||
|
68 | 74 | 3 1 test d1 |
|
69 | 75 | 3 1 test d1/d2 |
|
70 | 76 | 3 1 test d1/d2/b |
|
77 | 3 3 test newlink | |
|
71 | 78 | <?xml version="1.0"?> |
|
72 | 79 | <log> |
|
73 | 80 | <logentry |
@@ -81,6 +88,12 b' At revision 3.' | |||
|
81 | 88 | copyfrom-path="/a" |
|
82 | 89 | copyfrom-rev="2" |
|
83 | 90 | action="A">/b</path> |
|
91 | <path | |
|
92 | copyfrom-path="/link" | |
|
93 | copyfrom-rev="2" | |
|
94 | action="A">/newlink</path> | |
|
95 | <path | |
|
96 | action="D">/link</path> | |
|
84 | 97 | </paths> |
|
85 | 98 | <msg>rename a file</msg> |
|
86 | 99 | </logentry> |
@@ -88,12 +101,14 b' At revision 3.' | |||
|
88 | 101 | a: |
|
89 | 102 | b |
|
90 | 103 | d1 |
|
104 | newlink | |
|
91 | 105 | |
|
92 | 106 | a-hg-wc: |
|
93 | 107 | b |
|
94 | 108 | d1 |
|
109 | newlink | |
|
95 | 110 | % copy |
|
96 | 3:60effef6ab48 | |
|
111 | 3:0cf087b9ab02 | |
|
97 | 112 | assuming destination a-hg |
|
98 | 113 | initializing svn working copy 'a-hg-wc' |
|
99 | 114 | scanning source... |
@@ -107,6 +122,7 b' At revision 4.' | |||
|
107 | 122 | 4 1 test d1 |
|
108 | 123 | 4 1 test d1/d2 |
|
109 | 124 | 4 1 test d1/d2/b |
|
125 | 4 3 test newlink | |
|
110 | 126 | <?xml version="1.0"?> |
|
111 | 127 | <log> |
|
112 | 128 | <logentry |
@@ -126,13 +142,15 b' a:' | |||
|
126 | 142 | b |
|
127 | 143 | c |
|
128 | 144 | d1 |
|
145 | newlink | |
|
129 | 146 | |
|
130 | 147 | a-hg-wc: |
|
131 | 148 | b |
|
132 | 149 | c |
|
133 | 150 | d1 |
|
151 | newlink | |
|
134 | 152 | % remove |
|
135 | 4:87bbe3013fb6 | |
|
153 | 4:07b2e34a5b17 | |
|
136 | 154 | assuming destination a-hg |
|
137 | 155 | initializing svn working copy 'a-hg-wc' |
|
138 | 156 | scanning source... |
@@ -145,6 +163,7 b' At revision 5.' | |||
|
145 | 163 | 5 1 test d1 |
|
146 | 164 | 5 1 test d1/d2 |
|
147 | 165 | 5 1 test d1/d2/b |
|
166 | 5 3 test newlink | |
|
148 | 167 | <?xml version="1.0"?> |
|
149 | 168 | <log> |
|
150 | 169 | <logentry |
@@ -161,12 +180,14 b' At revision 5.' | |||
|
161 | 180 | a: |
|
162 | 181 | c |
|
163 | 182 | d1 |
|
183 | newlink | |
|
164 | 184 | |
|
165 | 185 | a-hg-wc: |
|
166 | 186 | c |
|
167 | 187 | d1 |
|
188 | newlink | |
|
168 | 189 | % executable |
|
169 | 5:ff42e473c340 | |
|
190 | 5:31093672760b | |
|
170 | 191 | assuming destination a-hg |
|
171 | 192 | initializing svn working copy 'a-hg-wc' |
|
172 | 193 | scanning source... |
@@ -179,6 +200,7 b' At revision 6.' | |||
|
179 | 200 | 6 1 test d1 |
|
180 | 201 | 6 1 test d1/d2 |
|
181 | 202 | 6 1 test d1/d2/b |
|
203 | 6 3 test newlink | |
|
182 | 204 | <?xml version="1.0"?> |
|
183 | 205 | <log> |
|
184 | 206 | <logentry |
@@ -88,3 +88,33 b' test symlink removal' | |||
|
88 | 88 | C b |
|
89 | 89 | C c |
|
90 | 90 | C s |
|
91 | ||
|
92 | replace broken symlink with another broken symlink | |
|
93 | ||
|
94 | $ ln -s linka linka | |
|
95 | $ hg add linka | |
|
96 | $ hg qnew link | |
|
97 | $ hg mv linka linkb | |
|
98 | $ ln -sf linkb linkb | |
|
99 | $ hg qnew movelink | |
|
100 | $ hg qpop | |
|
101 | popping movelink | |
|
102 | now at: link | |
|
103 | $ hg qpush | |
|
104 | applying movelink | |
|
105 | now at: movelink | |
|
106 | $ $TESTDIR/readlink.py linkb | |
|
107 | linkb -> linkb | |
|
108 | ||
|
109 | check patch does not overwrite untracked symlinks | |
|
110 | ||
|
111 | $ hg qpop | |
|
112 | popping movelink | |
|
113 | now at: link | |
|
114 | $ ln -s linkbb linkb | |
|
115 | $ hg qpush | |
|
116 | applying movelink | |
|
117 | patch failed, unable to continue (try -v) | |
|
118 | patch failed, rejects left in working dir | |
|
119 | errors during apply, please fix and refresh movelink | |
|
120 | [2] |
@@ -372,6 +372,17 b' forced overwrite of an existing file' | |||
|
372 | 372 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
373 | 373 | $ rm d1/ca |
|
374 | 374 | |
|
375 | attempt to overwrite an existing broken symlink | |
|
376 | ||
|
377 | $ ln -s ba d1/ca | |
|
378 | $ hg rename --traceback d1/ba d1/ca | |
|
379 | d1/ca: not overwriting - file exists | |
|
380 | $ hg status -C | |
|
381 | ? d1/ca | |
|
382 | $ hg update -C | |
|
383 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
384 | $ rm d1/ca | |
|
385 | ||
|
375 | 386 | replace a symlink with a file |
|
376 | 387 | |
|
377 | 388 | $ ln -s ba d1/ca |
General Comments 0
You need to be logged in to leave comments.
Login now