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