Mercurial > public > mercurial-scm > hg
comparison hgext/fastannotate/protocol.py @ 46946:b6b696442a4d
fastannotate: use `get_unique_pull_path`
The code does not support multiple destination yet, so lets move it to the
dedicated API.
Differential Revision: https://phab.mercurial-scm.org/D10412
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 14 Apr 2021 13:06:09 +0200 |
parents | 649d3ac37a12 |
children | c424ff4807e6 |
comparison
equal
deleted
inserted
replaced
46945:c1749dd31cdf | 46946:b6b696442a4d |
---|---|
17 hg, | 17 hg, |
18 pycompat, | 18 pycompat, |
19 util, | 19 util, |
20 wireprotov1peer, | 20 wireprotov1peer, |
21 wireprotov1server, | 21 wireprotov1server, |
22 ) | |
23 from mercurial.utils import ( | |
24 urlutil, | |
22 ) | 25 ) |
23 from . import context | 26 from . import context |
24 | 27 |
25 # common | 28 # common |
26 | 29 |
149 | 152 |
150 @contextlib.contextmanager | 153 @contextlib.contextmanager |
151 def annotatepeer(repo): | 154 def annotatepeer(repo): |
152 ui = repo.ui | 155 ui = repo.ui |
153 | 156 |
154 remotepath = ui.expandpath( | 157 remotedest = ui.config(b'fastannotate', b'remotepath', b'default') |
155 ui.config(b'fastannotate', b'remotepath', b'default') | 158 r = urlutil.get_unique_pull_path(b'fastannotate', repo, ui, remotedest) |
156 ) | 159 remotepath = r[0] |
157 peer = hg.peer(ui, {}, remotepath) | 160 peer = hg.peer(ui, {}, remotepath) |
158 | 161 |
159 try: | 162 try: |
160 yield peer | 163 yield peer |
161 finally: | 164 finally: |