Changeset - fc8a5cbfa0da
[Not reviewed]
default
0 1 0
domruf - 10 years ago 2016-03-31 20:53:23
dominikruf@gmail.com
compare: close Dulwich internals for Git repositories to avoid leaking open files

Fix failing test_compare.py on Windows by explicitly closing internal
object_store objects.
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/compare.py
Show inline comments
 
@@ -127,12 +127,15 @@ class CompareController(BaseRepoControll
 
                other_changesets = [other_repo.get_changeset(rev) for rev in reversed(revs)]
 
                if other_changesets:
 
                    ancestor = other_changesets[0].parents[0].raw_id
 
                else:
 
                    # no changesets from other repo, ancestor is the other_rev
 
                    ancestor = other_rev
 
                # dulwich 0.9.9 doesn't have a Repo.close() so we have to mess with internals:
 
                gitrepo.object_store.close()
 
                gitrepo_remote.object_store.close()
 

	
 
            else:
 
                so, se = org_repo.run_git_command(
 
                    ['log', '--reverse', '--pretty=format:%H',
 
                     '-s', '%s..%s' % (org_rev, other_rev)]
 
                )
0 comments (0 inline, 0 general)