This is an archive of the discontinued Mercurial Phabricator instance.

share: reload repo after adjusting it in postshare()
ClosedPublic

Authored by martinvonz on Nov 9 2018, 2:28 PM.

Details

Summary

When sharing a repo that's using remotefilelog, the upate that happens
at the end of the hg share call does not see the remote repo path
that's copied in hg.postshare(). This patch reloads the repo after
hg.postshare() to address that.

This changes a subrepo test case. Note that hg share -U; hg co tip
worked there before, so I don't see see why hg share should fail. I
also don't know what a "locally referenced subrepo". So maybe this is
fixing a bug? Hopefully it's not breaking something someone actually
cares about at least. Maybe someone who knows and cares about subrepos
can review this.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Nov 9 2018, 2:28 PM
This revision was automatically updated to reflect the committed changes.

I also don't know what a "locally referenced subrepo"

Basically, if you share the top level repo but don't update to a revision with a subrepo, the share command doesn't recurse and create a local subrepo under the share. That prevented share + update from the new share, if the update referenced the (missing) subrepo. The test was mostly just a random edge case to ensure things didn't explode, but it's better that the command actually does something useful.