mirror of
https://github.com/facebook/sapling.git
synced 2025-01-04 03:06:30 +03:00
pull: close peer repo on completion (issue2491) (issue2797)
When pulling changes from a compressed bundle Mercurial first uncompresses it to a temporary file in .hg directory. This file will not be deleted unless the bundlerepo (other) is explicitly closed. This is similar to cleanup that occurs after incoming.
This commit is contained in:
parent
202d2d5cf4
commit
0968676adc
@ -4605,8 +4605,10 @@ def pull(ui, repo, source="default", **opts):
|
||||
"""
|
||||
source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch'))
|
||||
other = hg.peer(repo, opts, source)
|
||||
try:
|
||||
ui.status(_('pulling from %s\n') % util.hidepassword(source))
|
||||
revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
|
||||
revs, checkout = hg.addbranchrevs(repo, other, branches,
|
||||
opts.get('rev'))
|
||||
|
||||
remotebookmarks = other.listkeys('bookmarks')
|
||||
|
||||
@ -4645,7 +4647,8 @@ def pull(ui, repo, source="default", **opts):
|
||||
ui.status(_("importing bookmark %s\n") % b)
|
||||
marks[b] = repo[remotebookmarks[b]].node()
|
||||
marks.write()
|
||||
|
||||
finally:
|
||||
other.close()
|
||||
return ret
|
||||
|
||||
@command('^push',
|
||||
|
@ -84,6 +84,11 @@ Pull full.hg into test (using --cwd)
|
||||
searching for changes
|
||||
no changes found
|
||||
|
||||
Verify that there are no leaked temporary files after pull (issue2797)
|
||||
|
||||
$ ls test/.hg | grep .hg10un
|
||||
[1]
|
||||
|
||||
Pull full.hg into empty (using --cwd)
|
||||
|
||||
$ hg --cwd empty pull ../full.hg
|
||||
|
Loading…
Reference in New Issue
Block a user