Page MenuHomePhorge

Update the extension to work with mercurial 6.4

Authored by speck on Apr 28 2023, 20:05.
Referenced Files
Unknown Object (File)
Thu, Sep 21, 06:15
Unknown Object (File)
Mon, Sep 11, 14:40
Unknown Object (File)
Sat, Sep 9, 03:57
Unknown Object (File)
Mon, Sep 4, 06:45
Unknown Object (File)
Sat, Sep 2, 22:45
Unknown Object (File)
Sat, Sep 2, 10:00
Unknown Object (File)
Thu, Aug 31, 22:40
Unknown Object (File)
Thu, Aug 31, 22:40



Mercurial 6.4 was recently released and showing up in package managers. With
the update to 6.4 using arc land would result in an exception indicating that
expandpath function does not exist.

The ui.expandpath function was deprecated in 5.8 and now removed in 6.4. The
functionality has been moved to utils.urlutil.get_ functions (they are split
between getting pull, push, and clone paths).

This updates the script to try utils.urlutil.get_clone_path function if the
ui.expandpath function is not present.

Imported from:

Test Plan

I updated my latest mercurial install to 6.4 and verified with hg --version.

I created a diff in a mercurial repo and used arc land to successfully land
the revision without any exceptions.

Closes T15288

Diff Detail

rARC Arcanist
Lint Not Applicable
Tests Not Applicable

Event Timeline

Thanks speck also for this patch in upstream Phorge :D

Hoping to be useful, here ready for merge

valerio.bozzolan edited the test plan for this revision. (Show Details)

I put +1 on this patch since I trust Evan completely but also because I like the try catch approach, trying to keep 100% backward compatibility. Thanks



✅ I see that you adopted another variable without overwriting source. I appreciated that.


✅ I can just say that the tuple url, path, branch seems correct to me

(Nice! Mercurial was on Phabricator ihih)

This revision is now accepted and ready to land.Apr 29 2023, 09:18

Thanks for the thorough review


Yeah 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.


Good 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)

Hi @speck, can I help to land this nice patch?

We really need to turn on T15042 so diffs can be landed from the webpage