Summary:
This command uses svnrev directly. However once we migrate to www-hg, this fields will
go and we can only use globalrev instead.
Let's add that and put it behind a config.
More context: https://fb.workplace.com/groups/248282915800791/permalink/372855146676900/
Differential Revision: D16560447
fbshipit-source-id: de3100ed1e6cc39eaaeff2fe11af04d2f1e2c41a
Summary:
context: Mercurial is slow for peoople that can't use watchman and eden https://fb.workplace.com/groups/scm/permalink/2133433800039562/
Please let me know if this approach (hacking the wctx) is acceptable in your
opinion
Reviewed By: quark-zju
Differential Revision: D15668362
fbshipit-source-id: a94f39be2d845e751a8bb69ca8ca000ef46d9d2d
Summary:
`cliparser` and `clidispatch` are more complete / compatible implemention for
related feature.
Reviewed By: xavierd
Differential Revision: D16575262
fbshipit-source-id: e78047a826896e1cd8529e14133d2821bc0955d3
Summary:
In some rare cases, it's possible that the "latest" file is created, but the
matching indexedlog isn't. Let's nicely recover from this by creating the
indexedlog in this case.
Reviewed By: kulshrax
Differential Revision: D16554090
fbshipit-source-id: 6b68d7806662b511917655a71c3a3c15ad6e1f64
Summary:
Fix the regression caused by D16557266 on error message. The fix is not the
most efficient, though. But it should restore the behavior.
Reviewed By: singhsrb
Differential Revision: D16557654
fbshipit-source-id: 2eb6956f99c931f94201b875c8bebb2219a794f0
Summary:
The last diff D16557266 caused a regression on the error message. Update the
test to show that.
Reviewed By: singhsrb
Differential Revision: D16557653
fbshipit-source-id: ce4a039f4c91a7bd61ea8e570de960880abae937
Summary:
When doing command name prefix match, if there are a unique match for non-debug
commands, use it. This solves `hg d` regression.
Note: we cannot simply use `starts_with("debug")` to test debug commands. That
is because debug commands can have aliases (ex. `debug|dbsh` as the command
name definition, and `dbsh` is also a debug command that does not starts with
`debug`). Therefore it gets a bit complex.
Reviewed By: kulshrax
Differential Revision: D16557266
fbshipit-source-id: 42d814940c9217d9e554bd0fe2769a53e0ee467f
Summary: Suggested by kulshrax, `I` and `l` are harder to distinugish. Rename it to clarify.
Reviewed By: kulshrax
Differential Revision: D16556868
fbshipit-source-id: 5892f0730f5205534851c5f7c024ff98f751423d
Summary:
Use the "first argument position" reported by the parsing library to expand the
command name correctly.
Before this patch:
--repo foo foo
^^^ this foo gets expanded (incorrectly)
After this patch:
--repo foo foo
^^^ this foo gets expanded
Reviewed By: kulshrax
Differential Revision: D16556869
fbshipit-source-id: 8eca98d80cdd8f0d3d329040d6f2eb81653db99f
Summary: This just makes the code slightly more confident.
Reviewed By: kulshrax
Differential Revision: D16556871
fbshipit-source-id: 5304c3e60c80242974d35a53aace84f829418bb8
Summary: This will be used to accurately replace the command line arguments.
Reviewed By: kulshrax
Differential Revision: D16556870
fbshipit-source-id: efb77a0da17c436e0123354746ba85201813992a
Summary:
Patterns like `--globalopt name name` could confuse the current logic. Add test
cases for it.
Reviewed By: kulshrax
Differential Revision: D16553454
fbshipit-source-id: dac5fd1a9f98093d13dbd85794e3b455c17dcf64
Summary: Expand `$1`, `$2` etc. in aliases. There are users depending on this behavior.
Reviewed By: kulshrax
Differential Revision: D16531016
fbshipit-source-id: fed735339adc82c4f52b74c4c4d62818bc047809
Summary:
This gives `expand_aliases` a chance to handle things like `$1`, `$2`, etc.
Related Python code assuming `expand_aliases` does not change args was removed.
Reviewed By: kulshrax
Differential Revision: D16530712
fbshipit-source-id: b81c2d29b9b9b5b93ce01627268a999a2cfd1ef0
Summary:
With the previous change, handling `[defaults]` and `[alias]` can be done
together.
Logic handling `[defaults]` separately is removed.
Unfortunately the new logic is duplicated in clidispatch and
bindings/clidispatch. In the future, bindings/clidispatch might just call
clidispatch.
Reviewed By: kulshrax
Differential Revision: D16530608
fbshipit-source-id: 5040d02da98d04a3f5cb43cc7f9cf0ef39a0f8ed
Summary:
This avoids calculating the full alias map, and provides more flexibility (ex.
the function can take care of `defaults` handling).
Reviewed By: kulshrax
Differential Revision: D16530514
fbshipit-source-id: 63558da5c9af36b2f8bc7689174fed71593a8186
Summary:
Make `expand_prefix` a public API to expand a command prefix to a full command
name.
Make Python binding handle the `strict` flag so `cliparser` does not have to.
This avoids calculation of `command_map` if strict is True.
Reviewed By: kulshrax
Differential Revision: D16530520
fbshipit-source-id: 5bf9c9f74ae074eac5e350a4db0ebc43f286cebf
Summary: This is the first step to support expanding things like `$1` in aliases.
Reviewed By: kulshrax
Differential Revision: D16530515
fbshipit-source-id: 3e81c92c2e2021b99815974f53286ec789ba0733
Summary:
The loop body can be changed to reduce some identation.
This changes the behavior a bit - an alias expanding to an emtpy string is now
an error. That's consistent with the original behavior.
Reviewed By: kulshrax
Differential Revision: D16530516
fbshipit-source-id: 3f5c2ebe9d8d1727cac706e4ff11f2678567c525
Summary:
When the alias cannot be split via shlex::split, raise an error directly
instead of silently ignoring it and fallback to Python error handling.
Reviewed By: kulshrax
Differential Revision: D16530519
fbshipit-source-id: d81534b198555b256f062dc4e6520fa40ace7700
Summary: `visited` does not need to be a HashMap to detect circular aliases.
Reviewed By: kulshrax
Differential Revision: D16530517
fbshipit-source-id: a27ee97ab8a80e6232600dbc062b0cac701c92a8
Summary: The code was added by D16497604. It does not seem necessary. Therefore remove it.
Reviewed By: kulshrax
Differential Revision: D16553455
fbshipit-source-id: 2d8a9bc54c975d10a9357360feac86b6ec78f794
Summary:
The code tests if `arg` (aka. command name) starts with `-`. That does not need
special handling because normally a command name does not start with `-`.
Reviewed By: kulshrax
Differential Revision: D16530518
fbshipit-source-id: 0bd2cdc04a27013ad856e86ee9e0e2705bf5bd57
Summary: This makes IPython work without disabling demandimport.
Reviewed By: xavierd
Differential Revision: D16509106
fbshipit-source-id: d4443d8b58c90a0fd7a34c620756e88f4f788337
Summary: Added shortcuts a, d that allow you to skip 1 day forward or back in the historical smartlogs interactive view
Reviewed By: mitrandir77
Differential Revision: D16438722
fbshipit-source-id: e61a126ed7390b5ee77ee71694d8b23f3351854a
Summary: The interactive view doesn't support the pager, so it is problematic for longer smartlogs. As a quick fix the interactive view only contains two weeks of commits. The full version is accessible through hg cloud sl --version_number
Reviewed By: mitrandir77
Differential Revision: D16496065
fbshipit-source-id: 7224258b426724872bf796af618ef70cbf4c9d0b
Summary: Replace original Python `hg root` implementation with Rust `hg root` implemented with the new command line dispatch library.
Reviewed By: quark-zju
Differential Revision: D16497604
fbshipit-source-id: e3d0e60d4bd4203897260c16e070ca3768ff1d22
Summary:
Implement `hg root` in Rust with the `clidispatch` library as well as adding all current Python commands so that prefix matching still works as expected.
This diff does not remove `hg root` from Python or expose native command documentation to Python, which will be the next diff.
Reviewed By: quark-zju
Differential Revision: D16454053
fbshipit-source-id: 78a9c70aeefb9adbb85c77001b15eab652417b2c
Summary:
Implementing the main dispatch logic including:
* registering command handlers
* dispatching to command handlers
* error handling
* alias expansion
* configuration loading
* repository loading ( path && sharedpath )
This dispatching is very closely mirrored to Mercurial's `dispatch.py` logic to not have surprising behavior, and is designed that during any error that occurs execution could fallback to the original Python code.
This diff does not actually change any behavior in hgmain. The next diff will implement `hg root` using this dispatch foundation.
Reviewed By: quark-zju
Differential Revision: D16452454
fbshipit-source-id: b32953d43c4fa0a2d9bf9978028a299efe203546
Summary:
When we had a "--no-something" flag registered providing "--something"
did the same thing as providing "--no-something" which is highly undesirable
(see task)
Reviewed By: quark-zju
Differential Revision: D16520376
fbshipit-source-id: 9d407b830067d095abdbd9c0cee674f424ffc0f9
Summary:
The shenanigan was introduced in D16337012 where I tried to reuse pushrevisionwithconfigs.
I am breaking the chain now as it's tooooo hard to reuse and we've spent 4-5 diffs on this now.
Reviewed By: xavierd
Differential Revision: D16520271
fbshipit-source-id: 94cf8580cf3b852ecf7897861893bb51ce03d564
Summary:
Add a method to wrap a Python `io` object (with `read` or `write` methods, ex.
`sys.stdin`, `ui.fout`, or `util.stringio()`) in a native Rust object so it can
be used in Rust code expecting Read / Write traits.
This will be used to expose the Rust "dispatch" logic to Python.
Reviewed By: sfilipco
Differential Revision: D16511017
fbshipit-source-id: cb1f5c20e392311cd648abe0528b971ab0266845
Summary:
With fastdatapack gone, the cdatapack bindings are no longer necessary and can
be removed.
Reviewed By: singhsrb
Differential Revision: D16476584
fbshipit-source-id: 130a9c5aed4e4f005876c420961f09d398f6e6aa
Summary: This is no longer used anywhere, we can remove it.
Reviewed By: singhsrb
Differential Revision: D16476582
fbshipit-source-id: fe6a8f33cbc3c37fb1d8fb33226352e41bcbaa2a
Summary: This code isn't used anywhere, let's get rid of it.
Reviewed By: singhsrb
Differential Revision: D16476583
fbshipit-source-id: d42376dbb2cf631a170ade3e2764d1f70922d882
Summary: This code is no longer used anywhere.
Reviewed By: singhsrb
Differential Revision: D16462343
fbshipit-source-id: 3e11994575a6de75562cb1ebd8839f7058abc075
Summary:
Our reverse sync job is too slow when pushing to svn. It seems like the slowness comes
keep doing push-pull-rebase which doesn't seem necessary in our case.
From my understanding, we need to do push-pull-rebase because we have multiple writers.
In our sync job, we only have one writer and therefore can we skip the pulls and rebases?
Reviewed By: DurhamG
Differential Revision: D16442559
fbshipit-source-id: 926d1c516e8e6d59298d310fc67927ace37f72c9
Summary:
This was removed in D16381346. The problem is in the ui which is always new. Lets keep a
reference to it when adding configs.
Reviewed By: xavierd
Differential Revision: D16494854
fbshipit-source-id: d206b6211c004e0fec57a2aeef6549b2f96cec17
Summary: This crate is no longer used by Mercurial, but may still be generally useful to others working with Rust HTTP libraries (such as Hyper, which Mercurial no longer uses but motivated the creation of this crate). Rather than just deleting this crate, let's move it to `common/rust`.
Reviewed By: quark-zju
Differential Revision: D16477315
fbshipit-source-id: 385a17751b289d5186dbd9771891c6679c6192ed
Summary: Set timezone to UTC to produce the same commit hashes.
Reviewed By: sfilipco
Differential Revision: D16501046
fbshipit-source-id: 4d36da07c08a4337ff6b8cb4135eaea22404ad39
Summary: Fix various Windows compatibility issues in the test.
Reviewed By: sfilipco
Differential Revision: D16501049
fbshipit-source-id: 72de26fc80a5f9e023e4b30cc2111810c7ff4626
Summary:
The old code replaces `\foo (esc)` to `/foo (esc)`, and break the `(esc)`
decoding. Change the order so we decode `(esc)` first before normalizing
the path.
Reviewed By: sfilipco
Differential Revision: D16501047
fbshipit-source-id: ac49fa89fe0123436a994548b045edc0cef0a982
Summary:
Make `import edenscm` take care of `sys.path` so as long as `import edenscm`
works, 3rd party pure Python dependencies and edenscmnative should be
importable.
This reduces adhoc sys.path handling in testutil.dott, and fixes an issue where
testing on Windows where `testuitl.dott` fails to run hg commands due to
missing 3rd party dependencies (because `edenscm.mercurial.entrypoint.run` is
not called, and edenscmdeps.zip is not in sys.path).
Reviewed By: sfilipco
Differential Revision: D16499458
fbshipit-source-id: 17e6e5754614dfcf352127d471c649ded4189e1a