sapling/edenscm/hgext
Thomas Orozco d6c8fef226 infinitepush: alias "default" path into "infinitepush"
Summary:
Through Scuba, we can identify quite a few users that are doing `hg push default` for an infinitepush: https://fburl.com/scuba/6vz3ien7.

This is typically happening in repositories where the `default-push` destination is not the hg repository.

In fact, we actually prompt users to use hg push default if they try to perform a scratch push to a svn repository a few lines below!

markbt suggested we should just replicate the push in this case as well, which I think is a good idea.

Simply replicating the push in this case is not quite enough, however!

Indeed, for our infinitepushes to go to both Mercurial and Mononoke, we would have to maintain an number of consistency rules between `default`, `infinitepush`, and `infinitepush-other`:

- `default` and `infinitepush-other` must point to opposite repositories (i.e. one Mercurial, one Mononoke), to serve users using `hg push default`.
- `infinitepush` and `infinitepush-other` must point to opposite repositories, to serve users using `hg push` without a path.

This effectively means `default` and `infinitepush` must be the same, and `infinitepush-other` must be the other. We could do this with path markers, but this is getting so complicated that I don't foresee us getting it right.

At the end of the day, the root cause of this complexity stems from the fact that we're using a destination that is now effectively a read path (`default`) for infinitepush writes. I think this was perfectly valid when default meant "Mercurial, not subversion", but not so much now that we have Mononoke in the mix.

Of course, we could just update the message and ask our users to use `hg push infinitepush` instead, but this would mess with their muscle memory as well as their shell history (not to mention that `hg push default` would silently do the wrong thing).

So, this patch updates the code to use the infinitepush "write" destination for writes when that is what the user intended.

 ---

As a side note, note that the current behavior is actually a little broken. Indeed, if one were to do `hg push default --to scratch/$FOO` while Mononoke is serving reads, the scratch would go to Mononoke. In this scenario, the scratch push would in theory have been accepted but would have had its bookmarks discarded (at least until we support htose in Mononoke :) ).

This probably never happened in practice, however, for two reasons:

- Most users and systems that actively push scratch bookmarks are actually pushing to a specific `hg.vip` path instead of `default` (one notable exception is On Demand WWW).
- `hg push` to Mononoke for a scratch bookmark doesn't actually work if you have the pushrebase extension code loaded in some way (either by enabling the extension, or enabling an extension that uses it). See D15576199 for the details.

Reviewed By: farnz

Differential Revision: D15576545

fbshipit-source-id: c28b808632505bb8e8f4d114029f7d8c17c9749e
2019-06-03 05:30:44 -07:00
..
absorb mutation: add absorb support 2019-04-11 02:45:16 -07:00
amend commands: help text for uncommit, unamend 2019-05-23 21:39:22 -07:00
commitcloud commitcloud: only take the lock when reading backup state for sync or backup 2019-05-31 03:44:08 -07:00
convert subrepo: remove subrepo support 2019-03-11 10:43:55 -07:00
extlib Convert scm/hg/edenscm/hgext/extlib/indexes to Rust 2018 2019-05-23 17:36:33 -07:00
fastannotate hgext: reformat using black 2019-03-13 18:35:09 -07:00
fastmanifest manifest: remove readfast, replace readdelta 2019-05-24 10:00:49 -07:00
fsmonitor debugrefreshwatchmanclock: don't trigger commitcloud autobackup 2019-05-16 02:40:26 -07:00
hgevents codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
hggit hggit: stop git-updatemeta walk when we finish commits with extras 2019-03-20 14:33:58 -07:00
hgsubversion hgsubversion: move to absolute import 2019-05-21 09:15:21 -07:00
highlight codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
infinitepush infinitepush: alias "default" path into "infinitepush" 2019-06-03 05:30:44 -07:00
lfs tracing: record lfs download size 2019-05-03 13:09:33 -07:00
memcommit memcommit: enforce target parent to be original parent 2019-03-13 11:50:42 -07:00
p4fastimport Make importer respect commits not done by itself 2019-05-10 10:10:57 -07:00
perfsuite metrics: slightly change the API 2019-03-20 22:49:18 -07:00
pushrebase disable pushrebase during infinitepush 2019-05-31 08:57:14 -07:00
remotefilelog remotefilelog: use util.unlink instead of os.unlink 2019-05-30 18:47:46 -07:00
repogenerator codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
treemanifest revisionstore: replace manual uses of mutabledatapack/mutablehistorypack 2019-05-28 10:06:51 -07:00
__init__.py codemod: move Python packages to edenscm 2019-01-28 18:35:41 -08:00
arcdiff.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
automv.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
blackbox.py blackbox: only log current commit if the changelog has been loaded 2019-05-30 04:02:54 -07:00
catnotate.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
checkmessagehook.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
checkserverbookmark.py mononoke-replay: move unbundlereplay and checkserverbookmark to util.timed 2019-05-25 10:57:49 -07:00
chistedit.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
churn.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
cleanobsstore.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
clienttelemetry.py blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
clindex.pyx blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
clonebundles.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
commitextras.py test-revset: do not use "hg branch" directly 2019-02-14 17:44:39 -08:00
conflictinfo.py hgext: reformat using black 2019-03-13 18:35:09 -07:00
copytrace.py copytrace: fix an issue where undesirable entries are reported 2019-02-25 12:43:20 -08:00
crdump.py hgext: reformat using black 2019-03-13 18:35:09 -07:00
debugcommitmessage.py subrepo: remove subrepo support 2019-03-11 10:43:55 -07:00
debugshell.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
dialect.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
directaccess.py branchmap: drop revbranchcache and other unused logic 2019-02-22 21:02:41 -08:00
dirsync.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
disablesymlinks.py disablesymlinks: add extension to disable symlinks 2019-02-06 08:41:34 -08:00
drop.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
edrecord.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
eol.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
errorredirect.py blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
extdiff.py subrepo: remove subrepo support 2019-03-11 10:43:55 -07:00
extorder.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
extutil.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
fastlog.py fastlog: patch follow revset instead 2019-04-16 22:19:19 -07:00
fbconduit.py fbconduit: introduce method for retrieving mirrored rev 2019-05-30 19:11:52 -07:00
fbhistedit.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
fixcorrupt.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
generic_bisect.py codemod: move Python packages to edenscm 2019-01-28 18:35:41 -08:00
githelp.py codeformat - remove weird looking + for string concat on the same line 2019-03-13 11:40:26 -07:00
gitlookup.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
gitrevset.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
globalrevs.py globalrevs: clean up the 'globalrev' template to not rely on hgsubversion 2019-05-31 12:16:54 -07:00
gpg.py hgext: reformat using black 2019-03-13 18:35:09 -07:00
grepdiff.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
grpcheck.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
hgsql.py hgsql: use mmap for hgsql revlog validation 2019-05-23 10:50:29 -07:00
hiddenerror.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
histedit.py histedit: fix call to hex in loginfo 2019-04-12 01:57:56 -07:00
infinitepushbackup.py commitcloud: incorporate infinitepush backups into commitcloud 2019-05-20 06:19:47 -07:00
interactiveui.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
journal.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
linkrevcache.py manifest: remove readfast, replace readdelta 2019-05-24 10:00:49 -07:00
logginghelper.py logginghelper: log normalized repo name 2019-03-04 00:05:00 -08:00
lz4revlog.py rust: move bindings to a single python extension 2019-02-01 17:53:22 -08:00
mergedriver.py tracing: trace mergedriver 2019-05-09 08:08:19 -07:00
morecolors.py blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
morestatus.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
myparent.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
nointerrupt.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
ownercheck.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
patchrmdir.pyx codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
phabdiff.py hg | phabdiff | Properly handle both 't' and 'T' prefixes for tasks when parsing them out of commit messages. 2019-04-29 14:41:38 -07:00
phabstatus.py hgext: reformat using black 2019-03-13 18:35:09 -07:00
phrevset.py phrevset: avoid crashing on null graphql reply 2019-04-09 07:53:43 -07:00
progressfile.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
pullcreatemarkers.py visibility: pullcreatemarkers should exclude hidden commits 2019-04-11 07:49:21 -07:00
purge.py docs: fix doc indentation error 2019-05-08 09:09:07 -07:00
rage.py blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
rebase.py blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
remotenames.py remotenames: include the filename in the file corrupted error 2019-05-28 13:26:35 -07:00
reset.py reset: fix visibility interaction 2019-05-03 17:44:51 -07:00
sampling.py sampling: silence BaseException.message deprecation warning 2019-04-22 17:58:07 -07:00
schemes.py hgext: reformat using black 2019-03-13 18:35:09 -07:00
sendunbundlereplay.py mononoke-replay: move unbundlereplay and checkserverbookmark to util.timed 2019-05-25 10:57:49 -07:00
share.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
shelve.py visibility: add shelve support 2019-04-26 01:07:30 -07:00
sigtrace.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
simplecache.py simplecache: add checksum to simplecache values 2019-02-20 13:56:33 -08:00
smartlog.py ui: add labelled prefixes to ui.write 2019-05-09 06:55:11 -07:00
sparse.py blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
sshaskpass.py sshaskpass: workaround sys.executable 2019-02-26 18:19:43 -08:00
stablerev.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
stat.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
traceprof.pyx codemod: move Python packages to edenscm 2019-01-28 18:35:41 -08:00
tweakdefaults.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
undo.py visibility: support undo after split 2019-04-26 01:07:30 -07:00
whereami.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
win32mbcs.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
win32text.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00