Mercurial > hg-git
comparison hggit/compat.py @ 1115:8ed6c0cae9b8
cleanup: add some blank lines
author | Sean Farley <sean@farley.io> |
---|---|
date | Mon, 27 Nov 2017 18:46:07 -0500 |
parents | e326b349eba6 |
children | 80664524802b |
comparison
equal
deleted
inserted
replaced
1114:6ef251fdbb30 | 1115:8ed6c0cae9b8 |
---|---|
35 except ImportError: | 35 except ImportError: |
36 # vfsmod was extracted in hg 4.2 | 36 # vfsmod was extracted in hg 4.2 |
37 from mercurial import scmutil | 37 from mercurial import scmutil |
38 hgvfs = scmutil.vfs | 38 hgvfs = scmutil.vfs |
39 | 39 |
40 | |
40 def gitvfs(repo): | 41 def gitvfs(repo): |
41 """return a vfs suitable to read git related data""" | 42 """return a vfs suitable to read git related data""" |
42 # Mercurial >= 3.3: repo.shared() | 43 # Mercurial >= 3.3: repo.shared() |
43 if repo.sharedpath != repo.path: | 44 if repo.sharedpath != repo.path: |
44 return hgvfs(repo.sharedpath) | 45 return hgvfs(repo.sharedpath) |
45 else: | 46 else: |
46 return repo.vfs | 47 return repo.vfs |
48 | |
47 | 49 |
48 def passwordmgr(ui): | 50 def passwordmgr(ui): |
49 try: | 51 try: |
50 realm = hgutil.urlreq.httppasswordmgrwithdefaultrealm() | 52 realm = hgutil.urlreq.httppasswordmgrwithdefaultrealm() |
51 return url.passwordmgr(ui, realm) | 53 return url.passwordmgr(ui, realm) |
137 } | 139 } |
138 } | 140 } |
139 | 141 |
140 hasconfigitems = False | 142 hasconfigitems = False |
141 | 143 |
144 | |
142 def registerconfigs(configitem): | 145 def registerconfigs(configitem): |
143 global hasconfigitems | 146 global hasconfigitems |
144 hasconfigitems = True | 147 hasconfigitems = True |
145 for section, items in CONFIG_DEFAULTS.iteritems(): | 148 for section, items in CONFIG_DEFAULTS.iteritems(): |
146 for item, default in items.iteritems(): | 149 for item, default in items.iteritems(): |
147 configitem(section, item, default=default) | 150 configitem(section, item, default=default) |
151 | |
148 | 152 |
149 def config(ui, subtype, section, item): | 153 def config(ui, subtype, section, item): |
150 if subtype == 'string': | 154 if subtype == 'string': |
151 subtype = '' | 155 subtype = '' |
152 getconfig = getattr(ui, 'config' + subtype) | 156 getconfig = getattr(ui, 'config' + subtype) |