comparison hggit/gitrepo.py @ 1094:5e49230a6cd5

fetch_pack: refactor to use compat.FetchPackResult This allows us to code against the current API of dulwich so that one day we can drop the code in compat.py.
author Sean Farley <sean@farley.io>
date Mon, 27 Nov 2017 17:49:04 -0500
parents 367f9e0dc198
children 8ed6c0cae9b8
comparison
equal deleted inserted replaced
1093:8e61d7a29932 1094:5e49230a6cd5
47 if namespace == 'namespaces': 47 if namespace == 'namespaces':
48 return {'bookmarks': ''} 48 return {'bookmarks': ''}
49 elif namespace == 'bookmarks': 49 elif namespace == 'bookmarks':
50 if self.localrepo is not None: 50 if self.localrepo is not None:
51 handler = self.localrepo.githandler 51 handler = self.localrepo.githandler
52 refs = handler.fetch_pack(self.path, heads=[]) 52 result = handler.fetch_pack(self.path, heads=[])
53 # map any git shas that exist in hg to hg shas 53 # map any git shas that exist in hg to hg shas
54 stripped_refs = { 54 stripped_refs = {
55 ref[11:]: handler.map_hg_get(val) or val 55 ref[11:]: handler.map_hg_get(val) or val
56 for ref, val in refs.iteritems() 56 for ref, val in result.refs.iteritems()
57 if ref.startswith('refs/heads/') 57 if ref.startswith('refs/heads/')
58 } 58 }
59 return stripped_refs 59 return stripped_refs
60 return {} 60 return {}
61 61