##// END OF EJS Templates
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho -
r3699:4bafcf7a default
parent child Browse files
Show More
@@ -915,8 +915,11 b' class queue:'
915 util.set_exec(repo.wjoin(f), mmap.execf(f))
915 util.set_exec(repo.wjoin(f), mmap.execf(f))
916 repo.dirstate.update(m + r, 'n')
916 repo.dirstate.update(m + r, 'n')
917 for f in a:
917 for f in a:
918 try: os.unlink(repo.wjoin(f))
918 try:
919 except: raise
919 os.unlink(repo.wjoin(f))
920 except OSError, e:
921 if e.errno != errno.ENOENT:
922 raise
920 try: os.removedirs(os.path.dirname(repo.wjoin(f)))
923 try: os.removedirs(os.path.dirname(repo.wjoin(f)))
921 except: pass
924 except: pass
922 if a:
925 if a:
@@ -1061,6 +1064,19 b' class queue:'
1061 else:
1064 else:
1062 self.printdiff(repo, patchparent, fp=patchf)
1065 self.printdiff(repo, patchparent, fp=patchf)
1063 patchf.close()
1066 patchf.close()
1067 added = repo.status()[1]
1068 for a in added:
1069 f = repo.wjoin(a)
1070 try:
1071 os.unlink(f)
1072 except OSError, e:
1073 if e.errno != errno.ENOENT:
1074 raise
1075 try: os.removedirs(os.path.dirname(f))
1076 except: pass
1077 # forget the file copies in the dirstate
1078 # push should readd the files later on
1079 repo.dirstate.forget(added)
1064 self.pop(repo, force=True, wlock=wlock)
1080 self.pop(repo, force=True, wlock=wlock)
1065 self.push(repo, force=True, wlock=wlock)
1081 self.push(repo, force=True, wlock=wlock)
1066
1082
@@ -207,3 +207,34 b' cat >>$HGRCPATH <<EOF'
207 git = False
207 git = False
208 EOF
208 EOF
209 hg qdiff --git
209 hg qdiff --git
210
211 cd ..
212 hg init slow
213 cd slow
214 hg qinit
215 echo foo > foo
216 hg add foo
217 hg ci -m 'add foo'
218 hg qnew bar
219 echo bar > bar
220 hg add bar
221 hg mv foo baz
222 hg qrefresh --git
223 hg up -C 0
224 echo >> foo
225 hg ci -m 'change foo'
226 hg up -C 1
227 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
228 cat .hg/patches/bar
229 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
230
231 echo
232 hg up -C 1
233 echo >> foo
234 hg ci -m 'change foo again'
235 hg up -C 2
236 hg mv bar quux
237 hg mv baz bleh
238 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
239 cat .hg/patches/bar
240 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
@@ -201,3 +201,46 b' copy to copy'
201 diff --git a/new b/copy
201 diff --git a/new b/copy
202 copy from new
202 copy from new
203 copy to copy
203 copy to copy
204 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
205 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
206 adding branch
207 adding changesets
208 adding manifests
209 adding file changes
210 added 1 changesets with 1 changes to 1 files
211 (run 'hg update' to get a working copy)
212 Patch queue now empty
213 applying bar
214 Now at: bar
215 diff --git a/bar b/bar
216 new file mode 100644
217 --- /dev/null
218 +++ b/bar
219 @@ -0,0 +1,1 @@
220 +bar
221 diff --git a/foo b/baz
222 rename from foo
223 rename to baz
224 2 baz (foo)
225
226 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
227 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
228 adding branch
229 adding changesets
230 adding manifests
231 adding file changes
232 added 1 changesets with 1 changes to 1 files
233 (run 'hg update' to get a working copy)
234 Patch queue now empty
235 applying bar
236 Now at: bar
237 diff --git a/foo b/bleh
238 rename from foo
239 rename to bleh
240 diff --git a/quux b/quux
241 new file mode 100644
242 --- /dev/null
243 +++ b/quux
244 @@ -0,0 +1,1 @@
245 +bar
246 3 bleh (foo)
General Comments 0
You need to be logged in to leave comments. Login now