Changeset View
Standalone View
support/hg/arc-hg.py
Show First 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | def localmarkers(ui, repo): | ||||
return markers | return markers | ||||
def remotemarkers(ui, repo, source, opts): | def remotemarkers(ui, repo, source, opts): | ||||
# Disable status output from fetching a remote. | # Disable status output from fetching a remote. | ||||
ui.quiet = True | ui.quiet = True | ||||
markers = [] | markers = [] | ||||
source, branches = parseurl(ui.expandpath(source)) | # Determine the remote to use based on the default path configured in | ||||
valerio.bozzolan: ✅ I see that you adopted //another// variable without overwriting `source`. I appreciated that. | |||||
Done Inline ActionsYeah I had do some digging in the mercurial source code to better understand these arguments. I probably should have renamed source to local_path as it's the path to the local repository on disk. If I remember correctly the mercurial source names this argument source which is likely why it was named this originally. speck: Yeah I had do some digging in the mercurial source code to better understand these arguments. I… | |||||
remote = hg.peer(repo, opts, source) | # [ui.paths] for this local repository. | ||||
# | |||||
# The expandpath function in the ui module was deprecated in 5.8 and removed | |||||
# in 6.4. NOTE: There is also an expandpath function in mercurial.util (not | |||||
# plural mercurial.utils...) however that function behaves differently from | |||||
# the old ui.expandpath. Reviewing the source comments for the old | |||||
# ui.expandpath function points to using urilutils.get_ functions. | |||||
try: | |||||
remote_path, branches = parseurl(ui.expandpath(source)) | |||||
except: | |||||
from mercurial import utils | |||||
origsource, remote_path, branch = utils.urlutil.get_clone_path(ui, source) | |||||
Done Inline Actions✅ I can just say that the tuple url, path, branch seems correct to me https://phab.mercurial-scm.org/D10401 (Nice! Mercurial was on Phabricator ihih) valerio.bozzolan: ✅ I can just say that the tuple `url, path, branch` seems correct to me
https://phab.mercurial… | |||||
Done Inline ActionsGood find on that phab revision -- I hadn't managed to find that one but was looking at others, gave up, cloned the mercurial source and started grepping~ It's unfortunate they no longer use phab. They've migrated to using heptapod which is a fork of gitlab that supports mercurial (I'm not 100% positive but I think they use hg-git to translate the mercurial commands on the server into git commands, so under the hood everything is still git) speck: Good find on that phab revision -- I hadn't managed to find that one but was looking at others… | |||||
remote = hg.peer(repo, opts, remote_path) | |||||
with remote.commandexecutor() as e: | with remote.commandexecutor() as e: | ||||
branchmap = e.callcommand(b'branchmap', {}).result() | branchmap = e.callcommand(b'branchmap', {}).result() | ||||
for branch_name in branchmap: | for branch_name in branchmap: | ||||
for branch_node in branchmap[branch_name]: | for branch_node in branchmap[branch_name]: | ||||
markers.append({ | markers.append({ | ||||
'type': 'branch', | 'type': 'branch', | ||||
Show All 19 Lines |
✅ I see that you adopted another variable without overwriting source. I appreciated that.