changeset 1091:367f9e0dc198

gitrepo: slight refactor to use {} instead of dict() This makes a following refactor easier to review.
author Sean Farley <sean@farley.io>
date Mon, 27 Nov 2017 17:40:59 -0500
parents 9965a927998a
children 3799bf885c1d
files hggit/gitrepo.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/gitrepo.py	Fri Dec 01 16:14:16 2017 -0800
+++ b/hggit/gitrepo.py	Mon Nov 27 17:40:59 2017 -0500
@@ -51,10 +51,11 @@
                 handler = self.localrepo.githandler
                 refs = handler.fetch_pack(self.path, heads=[])
                 # map any git shas that exist in hg to hg shas
-                stripped_refs = dict([
-                    (ref[11:], handler.map_hg_get(refs[ref]) or refs[ref])
-                    for ref in refs.keys() if ref.startswith('refs/heads/')
-                ])
+                stripped_refs = {
+                    ref[11:]: handler.map_hg_get(val) or val
+                    for ref, val in refs.iteritems()
+                    if ref.startswith('refs/heads/')
+                }
                 return stripped_refs
         return {}