Anonymous avatar Anonymous committed ff08304

bundlerepository: get rid of temporary bundle files (issue2478)

This bug was introduced in 40935b59518b and 6277a9469dff.

Comments (0)

Files changed (2)

mercurial/bundlerepo.py

     def close(self):
         """Close assigned bundle file immediately."""
         self.bundle.close()
+        if self.tempfile is not None:
+            os.unlink(self.tempfile)
 
     def __del__(self):
         del self.bundle

tests/test-mq-pull-from-bundle.t

   comparing with main.hg
   0: main: one added
   1: main: one updated
+  $ test -f ./fresh/.hg/hg-bundle* && echo 'temp. bundle file remained' || true
 
   $ hg -R fresh tincoming bundle:fresh+main.hg
   comparing with bundle:fresh+main.hg
 
   $ hg -R .hg/patches bundle --base=null ../queue.hgq
   1 changesets found
+  $ test -f ./fresh/.hg/hg-bundle* && echo 'temp. bundle file remained' || true
 
   $ cd ..
 
   $ hg -R .hg/patches tincoming ../queue.hgq
   comparing with ../queue.hgq
   0: queue: two.patch added
+  $ test -f .hg/hg-bundle* && echo 'temp. bundle file remained' || true
 
 Pull queue bundle:
 
   added 1 changesets with 3 changes to 3 files
   merging series
   2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  $ test -f .hg/patches/hg-bundle* && echo 'temp. bundle file remained' || true
 
   $ hg -R .hg/patches theads
   0: queue: two.patch added
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.