comparison mercurial/bundlerepo.py @ 14190:8aab5a82685f

bundlerepo: fix closing and docstring of getremotechanges I did not in fact implement what I documented about closing of the original repo. And there was a bit of leftover from an older version of the API.
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Wed, 04 May 2011 20:14:30 +0200
parents 8a0fca925992
children 7c231754a621
comparison
equal deleted inserted replaced
14189:328422b0380d 14190:8aab5a82685f
293 '''obtains a bundle of changes incoming from other 293 '''obtains a bundle of changes incoming from other
294 294
295 "onlyheads" restricts the returned changes to those reachable from the 295 "onlyheads" restricts the returned changes to those reachable from the
296 specified heads. 296 specified heads.
297 "bundlename", if given, stores the bundle to this file path permanently; 297 "bundlename", if given, stores the bundle to this file path permanently;
298 the returned "bundle" will be None. 298 otherwise it's stored to a temp file and gets deleted again when you call
299 the returned "cleanupfn".
299 "force" indicates whether to proceed on unrelated repos. 300 "force" indicates whether to proceed on unrelated repos.
300 301
301 Returns a tuple (local, csets, cleanupfn): 302 Returns a tuple (local, csets, cleanupfn):
302 303
303 "local" is a local repo from which to obtain the actual incoming changesets; it 304 "local" is a local repo from which to obtain the actual incoming changesets; it
346 def cleanup(): 347 def cleanup():
347 if bundlerepo: 348 if bundlerepo:
348 bundlerepo.close() 349 bundlerepo.close()
349 if bundle: 350 if bundle:
350 os.unlink(bundle) 351 os.unlink(bundle)
351 localrepo.close() 352 other.close()
352 353
353 return (localrepo, csets, cleanup) 354 return (localrepo, csets, cleanup)
354 355