How do I find out if I can push to a remote repository?

Viewed 51

In Mercurial, is there a way to find out if I'm authorized to push changes to a remote repository (without actually doing a hg push)? I simply want to verify that the settings in hgrc on the local and remote server is correct.

1 Answers

The only way to be really sure is to try it—and even then, if it succeeds, that just means you had permission; maybe you don't now.

That said, you can simply push to them a commit that you got from them, to see if you have all the permissions required to get that far. You will end up sending them nothing and writing nothing, but you'll test as much of that code path as you can test without actually sending them something.

Related