Summary:
wrong hex function was used
it should be converting node to hex representation rather than hex() built-in functions
Reviewed By: markbt
Differential Revision: D9309663
fbshipit-source-id: 3f245353403964acbcfaa7fa3f4baf0da9aa9a25
Summary: There are some leftovers uncaught by tests.
Reviewed By: singhsrb
Differential Revision: D9301679
fbshipit-source-id: 0178266a8f442a3d38288a21219af498ab9e3faa
Summary:
The uncommit command does some low-level changes to dirstate - it changes the
parents without updating the tree. Then it uses traditional dirstate APIs to
update the tree.
Treestate and traditional dirstate differ on the "remove" API - treestate would
make it a no-op-ish if the file is not already tracked. Traditional dirstate
would create such an entry blindly and then mark it as "removed".
Treestate cannot simply create the entry because it needs "EXIST_P1" or
"EXIST_P2" information, which is outside the "remove" API itself.
To fix this, teach "uncommit" to write a treestate entry in this case.
The longer term fix would probably be removing the low-level "setparents"
calls.
Reviewed By: DurhamG
Differential Revision: D9282452
fbshipit-source-id: 9a0f0ac2f1bc2a4296c10f95819457f4f9585a82
Summary:
The config parser (and the reset of Mercurial) API expects bytes.
Passing unicode literals will cause TypeError with the native config parser.
Reviewed By: DurhamG
Differential Revision: D8960875
fbshipit-source-id: 5d788947b9d57bf3bc009a8237602b0ff862b05e
Summary:
The old code is passing tuples like `("B", "ignore-blank-lines", None, _("ignore changes whose lines are all blank"))`
as config name to `ui.setconfig`, which is clearly wrong.
Also, the CLI flag does not match configs in the `[diff]` config section, ex.
`diff.ignore-blank-lines` is not the config option. `diff.ignoreblanklines` is.
`diff.ignore-all-space` is not the config option. `diff.ignorews` is.
The diffopts config overrides are not necessary since the options are passed to
the diff command any way. So just drop it.
Reviewed By: DurhamG
Differential Revision: D8945812
fbshipit-source-id: 97eb2b1020c7ed8036a06a74f1bbb39bb545721b
Summary: To get rid of `ui.backupconfig`.
Reviewed By: DurhamG
Differential Revision: D8886274
fbshipit-source-id: cf8d5134f55725b3945370aeb148987332e48b2c
Summary:
Modernize the code to use `with` instead of `try`. The motivation is to get rid
of `ui.backupconfig`.
Reviewed By: DurhamG
Differential Revision: D8886249
fbshipit-source-id: 21591a2e74e61215b0b55a493a8c3b94a63ca5d9
Summary:
We recently ran into issues with locks in pid namespaces [1]. Let's fix that
by using flock.
flock is more reliable in Linux's pid namespace use-case than file-existence
test, because it works without a /proc filesystem and does not have deadlock
issue if an hg process is killed unexpectedly (ex. OOM or SIGKILL).
The transition should be transparent:
- If the new code saw a symlink lock file generated by the old code.
`open(..., O_NOFOLLOW)` will fail and it's considered lock taken by the old
process correctly.
- If the old code saw a new lock file. It will treat it as system without
symlink support and it's considered lock taken by the new process correctly.
A non-symlink stale lock (regardless of whether it contains pid information or not)
will be confidently removed automatically by the new code.
The change is complicated because it works when both new and old hg
run at the same time. If we have migrated most users to the new code path,
the code can be cleaned up significantly.
[1]: https://fburl.com/85fxjisi
Reviewed By: DurhamG
Differential Revision: D9004614
fbshipit-source-id: d501c4f3a7bc8ad73c9556be1c6a265ffd0d0686
Summary:
workspace is not needed for get bundles request
this is small clean up to remove unused parameter
it didn't cause any fails
Reviewed By: mitrandir77
Differential Revision: D9219599
fbshipit-source-id: d4018b2c345db2549f6edf9d29abc475d4c0ba57
Summary: we crashed on empty result before this check
Reviewed By: markbt
Differential Revision: D9216307
fbshipit-source-id: 1f5ce5b0c783b25b45d51dbd3bb9f91a2eeee8b9
Summary:
Previously hggit used a single transaction for each commit it imported.
This added a lot of over head, such as writing the fncache every time and
committing to sql every time.
Instead, let's use a transaction that lasts a while. We'll tie it to the
existing gitmap save logic, so that we commit commits to disk before writing the
map file (so the map file never references commits that don't exist).
Reviewed By: quark-zju
Differential Revision: D9210162
fbshipit-source-id: 9b1302dfc824055742c4194dfaea7e172e5db6b4
Summary:
Apparently, the `continue` should apply to the `while` loop, not `for`.
This removes some random unnecessary SSH file fetches during unbundle.
Reviewed By: DurhamG
Differential Revision: D9174383
fbshipit-source-id: 9dad5c9e47d2d59fdc6421efd4bc303e791a6a9f
Summary:
There are 2 kinds of dependencies between nodes:
1. Parents (or copyfrom parent).
2. Delta-base.
Either of them cannot form cycles. But together they can. Previously they are
considered together, therefore infinite loops can occur. This patch removes
the dependency check for "delta-base" chains to solve the problem.
It hurts unbundle performance in theory as some deltas might be reapplied
multiple times. Practically, I guess nobody unbundles huge bundles in a
shallow repo, so it's probably fine.
Reviewed By: DurhamG
Differential Revision: D9174384
fbshipit-source-id: bbaaddaef4fce942337c64c5b72741eeff7a7a53
Summary: It was not effective because both `skipcount` and `len(queue)` grows unbounded.
Reviewed By: DurhamG
Differential Revision: D9173451
fbshipit-source-id: 3bb3597d7176ee3d0d6accca54c0db25ea7c83fa
Summary:
We shouldn't send a get_bundles request with empty list of heads to the server.
It is waste of time for performance and also there is a bug to handle it on the server.
We build an incorrect mysql query.
I will fix it on server side as well.
Reviewed By: DurhamG, quark-zju
Differential Revision: D9184401
fbshipit-source-id: 24cf9db33f1faf5bf790f1d20766d250eb58b21b
Summary:
A previous diff added a config option to block serving flat manifests.
We still need flat manifest serving for some of our mirroring infrastructure
(like git and svn mirroring), so let's add a bypass for those.
Reviewed By: quark-zju
Differential Revision: D9182861
fbshipit-source-id: 42d38000509c189dc5c85c5afeffe95f416726e3
Summary:
Pack file listings are generated in a loop that creates lambdas. Since python
lambdas capture by reference, they end up all using the same `path`.
A trick to avoid this is to pass the value as a default parameter to the
lambda.
Reviewed By: quark-zju
Differential Revision: D9154593
fbshipit-source-id: 4630bb590f6a7172cd850b2aa232848a6a5764d1
Summary: Speed up joining for users with many draft commits that have already been backed up by checking if their commits are already backed up.
Reviewed By: markbt
Differential Revision: D9065840
fbshipit-source-id: fcaf91b70cf6e0fc4c4bd747b0e44c37e50a3c86
Summary:
`hg cloud sl`
`hg cloud ssl`
is the future commands to look at somebody's else smartlog
trying to reuse defined ssl and sl templates
the only real place it uses changeling if hash shortening, so I have to use 'crop' instead
Reviewed By: quark-zju
Differential Revision: D8749430
fbshipit-source-id: e808623ad01d9a04681363bd2ca6d206da0ba1ce
Summary:
Add this as an experimental option
We don't have switching of workspaces so far, but hg clone is very fast with eden, so it is easy to create a brand new repo and join to any workspace.
This is already useful for debugging and repro user's issues.
You just join to the user's workspace from a brand new repo and can see what is going on there.
Reviewed By: quark-zju
Differential Revision: D9082157
fbshipit-source-id: 561314cddfced07c81c4bb6c1c2ccf99e140b27c
Summary: Changing ignored files should be fine if "-i" is not passed.
Reviewed By: wez
Differential Revision: D9121707
fbshipit-source-id: d11f41cba9d25d8945dff052dd4075150c2b3bfe
Summary:
The default workspace name is `user/<shortname>/default`. This is ambiguous,
as all of:
* fred.bloggs@example.com
* fred.smith@example.com
* fred@example.org
are rendered as `fred`.
This changes the default to use the full email, and provides a new config
option `commitcloud.email_domain`, which defines a single domain that is
dropped.
Reviewed By: liubov-dmitrieva
Differential Revision: D8998491
fbshipit-source-id: e108e116e82d3acc9f1ae1584c63266799fa8cc5
Summary:
Previously, we patch all callers in a pid namespaces to bypass hgsql sync.
It's hard to verify that covers all cases. Therefore, change hgsql to do the
check instead.
Reviewed By: DurhamG
Differential Revision: D9092807
fbshipit-source-id: ccd7485f34e70e2efda9c77b3cf3be89925f80bf
Summary: during `hg push`, LFS blobs are not uploaded with bundles. this diff adds the extra step [`uploadblobsfromrevs`](https://fburl.com/v05o1l6l) to upload LFS blobs. infinite push [uses a similar approach](https://fburl.com/hwk8yyq4).
Reviewed By: quark-zju
Differential Revision: D9039657
fbshipit-source-id: 2b1651970df1d3761536ef6433d1362756ea3811
Summary:
In order to convert a server repo to treeonly mode, let's first add a
config option that will block even sending flat manifests from a server
repository. This will allow us to find clients who aren't using treeonly mode
before we stop producing flat manifests for good.
Reviewed By: quark-zju
Differential Revision: D9075308
fbshipit-source-id: 1bdce7b55ccb20c2c047939b89571b083d6fba8e
Summary:
In a future diff we'll need to read a repository's bundle2 capabilities
while creating a strip backup bundle. To do so, we need to pass the bundle2
capabilities to the strip backup bundle creation logic.
This may enable a bunch of features in strip backup bundles now, like newer
formats that were gated behind capabilities.
Reviewed By: quark-zju
Differential Revision: D9075304
fbshipit-source-id: 17109284d2cd81ae467474089c1438c11edcd085
Summary:
I noticed many users have ".hg/blackbox.log" owned by root, which seemed to be
done by some less thoughtful automation. Blackbox became useless in that case.
This diff adds logic to rotate away those read-only files automatically.
Reviewed By: farnz
Differential Revision: D8974366
fbshipit-source-id: d63ff2ebdcfd5f85067e89b38b1ca174d0ea6f45
Summary:
mq is already somehow problematic at D8907646. Without bandwidth supporting
it, let's remove it.
Alternative to mq would be rebase, shelve, unshelve, histedit.
Maintain "--config extensions.mq=" compatibility by marking it builtin so hg4idea
won't break by this change.
Reviewed By: phillco
Differential Revision: D9039741
fbshipit-source-id: a3a1e48a2a982ff8e8b6a6ce659c906a4e2b2b36
Summary: Replace an ugly hack with an less ugly hack for great winning
Reviewed By: quark-zju
Differential Revision: D9029088
fbshipit-source-id: 1cb4783fbe92ad122e540beb9e32caea0b418054
Summary:
Resend of https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-May/097695.html
Like the previous patch, this simplifies the code, and could make things faster
for mode-only changes.
Reviewed By: DurhamG
Differential Revision: D8986781
fbshipit-source-id: 993a97ade9a41627735a65919de9ab52b600a180
Summary:
In a previous diff we stopped pushrebase from sending flat manifests
back to treeonly client, but we didn't stop pushrebase from analyzing from
analyzing the manifests to decide what files to send. It turns out that this can
be expensive, since it needs to diff two manifests.
Let's fix up the bundle2 capabilities so that pushrebase knows to not send files
back to the client for a remotefilelog client.
Reviewed By: markbt
Differential Revision: D9021066
fbshipit-source-id: ba422ce8b5ada7905e4900ec68957a84613897ff
Summary:
`hg rage` attempts to find interesting obsmarkers related to the user's
smartlog. This turns out to be very slow for users with lots of obsmarkers,
and generates very long rage output in this case.
Instead, just put the last 100 obsmarkers in the rage output. If earlier
obsmarkers are needed, we can look for them separately.
Reviewed By: ryanmce
Differential Revision: D9027952
fbshipit-source-id: 0368d5e83bced77bb863d223927d614407f19fe1
Summary:
Some `hg rage` steps may be slow. Add a profile so we can see which ones these
are.
Reviewed By: ryanmce
Differential Revision: D9027796
fbshipit-source-id: 6e478bee1f1265e4e80c067968da6821c7e071c9
Summary:
our application code is setting the wait_timeout to 300s, this results in idle timeout for db query
this code path will be deprecated with Mononoke, so the simplest solution is to increase the timeout
Reviewed By: jrahman
Differential Revision: D8998850
fbshipit-source-id: 12ca2864874abfe2f7b8e7da0cd1309c927931f6
Summary:
Now that rust datapacks implement markledger and cleanup, let's allow
using them during repacks.
Reviewed By: quark-zju
Differential Revision: D8895356
fbshipit-source-id: a5520316170b17ac14bf07de1f79143d3544b84a
Summary:
Let's use the pathencoding crate instead of a lossy conversion to
strings.
Reviewed By: quark-zju
Differential Revision: D8992738
fbshipit-source-id: 2975b421a3de5d7fafb6688260d9482af701092e
Summary:
The paths for each data pack are used in various situations (repack,
error reporting, etc) so let's store them and make them accessible via the
python api.
Reviewed By: quark-zju
Differential Revision: D8884773
fbshipit-source-id: 4108c98b4e303ba9bded1f264746fa4a84845c73
Summary:
For some reason, buck cython build starts to treat unprefixed strings as
unicode strings. That breaks Mercurial where everything should be bytes.
Therefore add the b prefix to make them byte strings explicitly.
Reviewed By: DurhamG, ryanmce
Differential Revision: D9015176
fbshipit-source-id: 7a3ef9d735362e3ae02208ec19d0551bf0adaaa4
Summary:
shortuser is parsed from email address
for these 2 path of the disk we need to use util.getuser()
Reviewed By: singhsrb
Differential Revision: D8997967
fbshipit-source-id: cee983fe8ea19276e0b134f908af082cda7ed371
Summary:
A future diff will expose this data from the rust pack implementation,
so we need them to be expoed as functions instead of attributes.
Reviewed By: quark-zju
Differential Revision: D8884705
fbshipit-source-id: 401e5c0d24039c68063d4e9171fefefaf7c2bdff
Summary:
Adds a config option that enables using rust data packs instead of
cdatapacks.
Reviewed By: quark-zju
Differential Revision: D8813134
fbshipit-source-id: c8948e2aef2486bf80d0306d89dd2ebc1b9fddcf
Summary:
Previously it would only accept lists. This was fine for remotefilelog,
but treemanifest actually passes generators here, so we need to change this to
accept an iterator.
Reviewed By: quark-zju
Differential Revision: D8813143
fbshipit-source-id: 1d0cbf32d4c56521e26c55a6a061c22a1e618aed
Summary:
Rust pack files don't support repack yet, so let's disable them during
that. This requires rebuilding the stores, so we added the ability to invalidate
the stores during a repo invalidate (which arguably should've been there in
the first place).
A future diff actually adds this config option.
Reviewed By: quark-zju
Differential Revision: D8813132
fbshipit-source-id: d1d5f30ff2708b6686ed8d491d49558b3dde8314
Summary:
Previously we converted all rust errors into python KeyErrors. Let's
cast KeyErrors into python KeyErrors and everything else into RuntimeErrors for
now. We can expand this as needed.
Reviewed By: farnz
Differential Revision: D8775753
fbshipit-source-id: f72e96db752167110d989226f2dedb9ff5bd82a3
Summary:
This function is present on the python data store api, so let's
replicate it here. Later we should come back and refactor this to be a special
case of the get_delta_chain result, but for now we'll maintain the custom API so
we can start using this code from python.
Reviewed By: quark-zju
Differential Revision: D8774474
fbshipit-source-id: aabcff3a43ae68859a1bf3b23f433214571b1a9d
Summary:
When investigating https://fburl.com/h4qw0060, I noticed `clindex`'s
partialmatch took 10ms per lookup. Looking at clindex code, it maintains two
indexes - one powered by the Rust radixbuf, and another normal Python dict for
"overrides".
When the "overrides" get big enough, "partialmatch" would be slow because it
has O(overrides) complexity. And perftweaks' "cachenoderevs" feature will
call "index.__setitem__" which populates the "overrides" dict.
D8626199 was an attempt to fix perftweaks. But it uses a wrong condition:
if not (ui.config("extensions", "clindex") or "!").startswith("!")
should be:
if not ui.config("extensions", "clindex", "!").startswith("!")
This patch should fix it. As we're here, also disable fastpartialmatch
explicitly if clindex is enabled.
In the future, indexedlog would solve this cleanly - "overrides" would be
part of the real index that supports efficient prefix lookup, instead of a
Python dict.
Reviewed By: ryanmce
Differential Revision: D8985248
fbshipit-source-id: 676863cb33b1ee974c47c243c5eca4c9c19174be
Summary:
enables lfs for pushrebase and adds tests.
using
```
> [pushrebase]
> rewritedates = True
```
in the tests so that pushrebase actually changes the hash of the commit
Reviewed By: DurhamG
Differential Revision: D8939281
fbshipit-source-id: a3b95962635bb1f7926889c2869ea79cfca8132d
Summary:
Fix subtreeiter_create() to avoid calling the `SubtreeIterator` destructor on
an object that it never constructed.
If an error is thrown constructing the `cmpNodes` vector or calling the
`SubtreeIterator` constructor, then the `SubtreeIterator` destructor should
not be called. However, the `subtreeiter_create()` previously used
`Py_DECREF` to clean up the object, which always invoked
`subtreeiter_dealloc()` and called the `SubtreeIterator` destructor.
It looks like a lot of the other python object types declared in this file
have similar problems, and may incorrectly invoke C++ destructors on objects
that were never constructed if something goes wrong during object
initialization. I have not fixed the other types yet as part of this diff.
The initialization logic for each type looks somewhat different, so they will
each need different fixes rather than this simple change of just calling
`PyObject_Del()` rather than `Py_DECREF()`.
Reviewed By: quark-zju
Differential Revision: D8963858
fbshipit-source-id: d610cac16133a7ff2350c17b13b5ebc7b7becc29
Summary:
fastheaddiscovery is a remotenames feature which makes discovery faster but
less precises. For example, it can request more commits from the server than
necessary. That's not a big deal during pulls, but it can be a problem during
push. It may try to push public commits to the server. People can ran into this
behaviour when they pull commit cloud commit from another devserver and this
commit is based on a newer public commit.
Reviewed By: quark-zju
Differential Revision: D8931322
fbshipit-source-id: 03c6f1df23c3742bda12adf40bf477711f7835bb
Summary:
This commit enables embedding global revisions in commits created via
the `hgsubversion` extension.
Reviewed By: quark-zju
Differential Revision: D8925897
fbshipit-source-id: 17f320dd7b6ca560acb78ba8e5ee26a8a3a6b045
Summary:
When constructing the pushrebase reply part, we weren't passing the
bundlecaps along, so it was creating a normal flat-manifest changegroup. A
treeonly client that received this would have to translate it to a tree, which
was expensive for pushes that returned a lot of manifests.
The fix is to pass the appopriate bundle caps to the changegroup creation. Since
we don't have access to the bundle1 caps inside a bundle2 part handler, we had
to update the treeonly logic to also pass treeonly=True caps as bundle2 caps.
Reviewed By: StanislavGlebik
Differential Revision: D8958866
fbshipit-source-id: 4d68031aedb61ae4b113ea9376c704c7548f029c
Summary:
It's similar to acl and notify - not used and can be done using hooks
externally.
Note the bugzilla extension actually works with the Rust config parser,
unlike acl and notify.
Reviewed By: DurhamG
Differential Revision: D8953126
fbshipit-source-id: 43b12666e4d9c03f800395613eed06783aac48b3
Summary:
Similar to the acl extension, notify is not used here and can be implemented
as hooks.
The direct motivation is, it uses weird key in config names that get rejected
by the Rust config parser:
```
hg: parse error: ".../.hgrc":
--> 61:4
|
61 | */a#branch(test) = will_no_be_send@example.com
| ^---
|
= expected equal_sign
```
Although the pest syntax can be updated to support this case, by using
different `name`s for sections, and config names. It seems cleaner to
just drop notify, as it's the only trouble maker.
Reviewed By: DurhamG
Differential Revision: D8953127
fbshipit-source-id: fc7760a32b6ea538cb207c860aadac7b4b58027f
Summary:
It's rarely used here and feels like a burdern to continue support.
It only restricts write access. A well-designed commit hook API should be the
superior solution here.
The direct motivation of the removal is becuase it does not work well with the
Rust config parser. Namely it's the unique extension that treats an empty
section differently from an section that isn't set. That does not play well
with the Rust config parser. While it can be worked around like D8887670, it's
not a very clean soution, and there are other issues making test-acl.t fail.
Therefore, instead of trying to find the remaining weirdness of acl, I figured
it's probably the right call to drop it and redirect users to hooks instead.
Reviewed By: DurhamG
Differential Revision: D8953125
fbshipit-source-id: 209f04423ccdf182b0ba4021b59d26525173d73c
Summary: Provide better user experience when vpn is off
Reviewed By: quark-zju
Differential Revision: D8950997
fbshipit-source-id: 50db83c1ac3ee11045ecb64e6d8425cb821a0650
Summary:
`test-hgsql-sqlrefill.t` exposes an issue which leads to the
repository ending up in an uncommittable state. This commit fixes that issue by
adding the expected data to the database.
Reviewed By: quark-zju
Differential Revision: D8925906
fbshipit-source-id: 1e0ec827df6e755f72575b03f094b0ca5a400e9b
Summary:
`test-hgsql-sqlrefill.t` exposed an issue with `sqlrefill` where the
database is inconsistent with the state of the repository if the repository had
no data in the database before the invocation of `sqlrefill`. This commit fixes
that issue by also updating the `revision_references` table in this case.
Reviewed By: quark-zju
Differential Revision: D8925895
fbshipit-source-id: ca94ba1b3bd168128edc0c845b2fc1439c15181c
Summary:
We update two different schemas in the database during the commit and
it makes sense to isolate this logic in a method. As part of this refactor, we
are also removing `_validatependingrevs` dependency on `self.pendingrevs` which
needlessly restricted the scope of the method.
Reviewed By: quark-zju
Differential Revision: D8925905
fbshipit-source-id: 612c908f39f0902784c1807bed01caa0cd67fa53
Summary:
`sqlrecover`, `sqlrefill` and `sqlstrip` use `ui.environ["PWD"]` to
get the current working directory which leads to not respecting the global
`--cwd` option to the Mercurial commands. This commit switches to using
`pycompat.getcwd()` instead which fixes this issue.
Reviewed By: quark-zju
Differential Revision: D8925908
fbshipit-source-id: 743bf3f6dda0a8545b171b01c1f7d3288f2936b7
Summary:
As an intermediate step in conversion of the `WWW` repository to being
an Mercurial only repository, we will be modifying the `hgsubversion` extension
to start supporting `globalrev` in the commits pulled from the source
Subversion repository.
The `globalrevs` extension needs to allow for creation of commit through means
other than pushrebase for this process to succeed. Therefore, let's introduce a
configuration option for this purpose.
Reviewed By: quark-zju
Differential Revision: D8925894
fbshipit-source-id: ecb253828c0801c1c39f57ccaf2e11992a924e63
Summary:
This commit just uses the `configitem` to specify the default for the
configurations items relating to `globalrevs` extension.
Reviewed By: quark-zju
Differential Revision: D8925901
fbshipit-source-id: 6d4cf10a2e623b94d3a94eeb1f411d784374a4d5
Summary:
Rather than having a comment which specifies that this code path won't
be hit on the client, it's probably better to only execute the new code if the
repository is on the server.
Reviewed By: quark-zju
Differential Revision: D8925902
fbshipit-source-id: 9404ad9e33f95f580d04d5aa3d40225ecc1dc7b4
Summary:
I noticed when `amend --rebase`ing that rebase was refusing to run because my working copy was dirty. That shouldn't happen with `amend --rebase` because the working copy won't move.
I realized you can pass revisions in the rebaseset that won't be rebased, which is what was happening here. So, let's move this check to look at the generated `destmap`, which is the definitive source of truth for what will move.
Reviewed By: quark-zju
Differential Revision: D8921695
fbshipit-source-id: 292e8d14342adf70a4f693d91a9a3f2aad4f2ff9
Summary: make ux better when waiting for background cloud sync to complete by showing progress bar
Reviewed By: quark-zju
Differential Revision: D8735116
fbshipit-source-id: 94659422a6fb16e540964c8b5f3316b1bb0a837f
Summary:
This uses the --noconflict flag added in the previous diff to make auto-restacking, as long as there aren't conflicts or a mergedriver run, trivial.
It creates the `amend.autorestack` flag with four options:
- `never`: never attempt to restack.
- `only-trivial`: restack only if the manifest is unchanged (the old behavior). We can remove this after the rollout.
- `no-conflict`: restack if there won't be merge conflicts.
- `always`: always attempt to restack.
Reviewed By: DurhamG
Differential Revision: D8721726
fbshipit-source-id: 620c08f6082033272dde35cb27b199615f16a787
Summary:
If pulling or pushing to a new remote server, remotenames may call
`journal.record()` many times. Internally it does a few filesystem seek, and it
can be slow. With `recordmany()` we will pay the cost of seeks ony once.
Reviewed By: quark-zju
Differential Revision: D8873998
fbshipit-source-id: 385542bae7f210eb4f0bba3a02a13e7a4ce76d1d
Summary:
When creating the two first-order diffs we are currently diffing the two revs to the parent of rev1. This was something I was playing around with before but actually doesn't make sense. This returns things to diffing rev1 to rev1's parent and rev2 to rev2's parent.
I think the problem I was trying to work around was seeing files appearing to be changed not to do with either rev1 or rev2. The correct fix for this is to only consider files which are in rev1 or rev2.
Reviewed By: quark-zju
Differential Revision: D8904312
fbshipit-source-id: f48bd498cc27ea650a859d7b318f32520f946150
Summary:
As written, merge tools and drivers are responsible for raising `InMemoryMergeConflictsError` themselves. We shouldn't finish merge.update with unresolved files under IMM.
However, we had this fallback in case we missed a spot, and it turns out there was such a spot: D8886237.
D8699551's addition of required parameters to the constructor broke this fallback. So, this adds the parameters back in.
Reviewed By: quark-zju
Differential Revision: D8886238
fbshipit-source-id: 111fcce6a5a38d126c0118208e508c04b7566971
Summary:
This lru cache keeps recently accessed revlogs in memory for fast
access. Originally we had it set to 15 since we estimated that would likely be
longer than most directory paths. It turns out this causes significant slow
downs in some of our mirroring jobs because big revlogs, like the root tree, may
be discarded from the lrucache.
So let's crank this up to 100. This should still bound memory nicely, while
giving us better cache hit rates.
Reviewed By: quark-zju
Differential Revision: D8879648
fbshipit-source-id: d7b6e4244a6e403b7299b61de5d469004667497c
Summary:
Now that all the business logic is reusable, let's create a python
datapack wrapper. In a future diff we'll allow Mercurial to instantiate this
instead of the existing cdatapack and datapack classes.
Reviewed By: quark-zju
Differential Revision: D8774486
fbshipit-source-id: 0df8ec0cc4ae7ebfc380c496b85555c78d5da505
Summary:
In a future diff we'll be add a python datapack wrapper, in addition to
the existing datastore wrapper. The logic inside them is basically identical, so
let's move all the existing logic out to a trait that can wrap all DataStore implementations.
Reviewed By: quark-zju
Differential Revision: D8774257
fbshipit-source-id: ecb9a5d174decb803c1b1216db2d366b5215ab89
Summary:
While investigating T30931730, I wondered why Eden importer needs to access
dirstate. Turned out the sparse extension would construct it in `reposetup`.
Changing that to a cheaper test - `repo.local()` to avoid loading dirstate.
A local repo always has a dirstate.
Reviewed By: simpkins
Differential Revision: D8669930
fbshipit-source-id: b738f7d888fe8ad62c9a29bd910230f62278a7af
Summary:
To make Mononoke dogfoodable, we need to add this change.
In D8734958 I've added force pulling from `infinitepush` path in some cases
(i.e. when user does `hg pull -r HASH`)
However that's not enough. Changing the path to `infinitepush` results in
remotenames adding lots of new bookmarks to `.hg/remotenames` file like
`infinitepush/master`, `infinitepush/stable` and so on. First of all, that means that
they will show up in smartlog and make it more cluttered. Secondly, and more
importantly, it will result in adding lots of bookmarks to the repo.journal -
https://fburl.com/80hy1rv5 . Turns out, that can be very slow.
Reviewed By: farnz
Differential Revision: D8859001
fbshipit-source-id: 973c0ab13563a7010077fdb016f43106b1fba744
Summary:
The `arcdiff` hg extension is useful in concept - showing the changes since last Phabricator upload, but in practice there is usually too much noise in the output from rebasing. For example, consider the case where I have a stack and haven't re-uploaded the current commit. If one of the ancestors in the stack has changed and I use `--changes-since-last-arc-diff` I end up seeing those changes mixed plus the changes to the the ancestor.
Here we introduce a feature to show only a diff of the current commit vs. Phabriactor's version of the commit i.e. a diff of a diff, or "second-order" diff. The goal is not to perfectly reconstruct the changes, just to highlight what changed for human consumption. There are no line-ranges or context in the diff output, but it still seems pretty usable.
This new feature is invoked via the option `--changes-since-last-arc-diff-2o` to `hg diff`.
Reviewed By: quark-zju
Differential Revision: D8787504
fbshipit-source-id: 2885a118a712a3d9187e6fce67a465e7b664c3ca
Summary: --since-last-submit is the new hotness
Reviewed By: quark-zju
Differential Revision: D8851071
fbshipit-source-id: 3cc7a9b9c32631bc507fb3bee74db7e5ae95f802
Summary:
Previously, the fastmanifest factory class kept a copy of the initial ui object
from uisetup(). This meant it executed all things using the configuration of the
first repository. In a command that opens many repositories, like hg pull or hg
gc, this caused it to use the wrong configuration.
To fix this, let's switch as much of the fastmanifest factory to use
manifestlog.ui (which is the repo specific ui) instead of self.ui. We can't get
rid of self.ui just yet, since it's still required for the revlog.add()
override, but this fixes the hg gc breakage. We should fix the revlog.add case
later too.
Reviewed By: quark-zju
Differential Revision: D8840003
fbshipit-source-id: 037dcf98422826a0223a9941c2a5931b7408b2a5
Summary:
Running this test with watchman exposes an issue in fsmonitor where ignore
rules are not respected for autditpass files. Therefore an ignore check was
added.
Reviewed By: phillco
Differential Revision: D8842387
fbshipit-source-id: 16fa8776eb4a36b07c1ddbc7b96ef6eddf9d7ae8
Summary:
If pushrebase.enablerecording and the rest of the parameters are set then let's
save pushrebase requests. It involves saving the changegroup and treemanifest
bundles2 parts to bundlestore, and then inserting an entry into the database
Reviewed By: quark-zju
Differential Revision: D8801602
fbshipit-source-id: bea4f798daa8542541c8d7c4c2a051c8583930a0
Summary:
Common library to interact with mysql. Will be used in the next diffs to record
pushrebase requests
Reviewed By: quark-zju
Differential Revision: D8801603
fbshipit-source-id: 1a926742cc40458e8f9da385620f0f3837f3ae09
Summary:
For request recording we want to treat conflicts separately. Let's add a
special exception for that.
Reviewed By: quark-zju
Differential Revision: D8787567
fbshipit-source-id: 8bee7e1a61763982e74fbaf15a9320d1d565fd76
Summary:
The file is already quite big, and I'm going to add request recording
functionality soon. Let's move it in a separate package
Reviewed By: quark-zju
Differential Revision: D8787566
fbshipit-source-id: c0202d2ebf1e1662d4b02b966035f6cce9d2344e
Summary: It seems likely that we'll want to capture environmental vars and log them. Let's make this really easy to do by parsing a config list.
Reviewed By: quark-zju
Differential Revision: D8810693
fbshipit-source-id: 25f507323e3fc4b8c666c66429001189ad7dc7ef
Summary:
`lstrip` removes *all* of the characters in the given set from the beginning of the string. It doesn't just remove the given prefix, which I think was the intention.
So if you specified `key.env_vars=...`, `key.e` would be stripped, not just `key.`, and `nv_vars` would be set instead of `env_vars`
Reviewed By: quark-zju
Differential Revision: D8810694
fbshipit-source-id: 5f93bd9bdb660430c59ed7ae7e6ff7a7edcf4764
Summary:
hg debugobsolete section of hg rage: skip very old data
it will help users with old repos like this:
P59801250
from 2015
I am worried that after that diff it seems to be impossible to know the repo age but we should provide it in another way
Reviewed By: DurhamG
Differential Revision: D8787883
fbshipit-source-id: eb8be28a87449006846eb985a98de6f85a0b5e63
Summary: Makes syncimporter case insensitive for p4 paths to properly handle Perforce's case insensitivity.
Reviewed By: zhh95
Differential Revision: D8777555
fbshipit-source-id: 8d39f2455f42b27a3a3341c02901ed31398cc5bd
Summary:
Previously, callers could access the datapack's path via the 'path'
field. In the rust implementation fields won't be accessible, so let's change
this to an accessor function instead.
Reviewed By: singhsrb
Differential Revision: D8773923
fbshipit-source-id: faea2f99e2dff99f3b6300f575bb9ff2ac178a11
Summary:
A recent change made delta base's be Option types, and when we
encounter a None we treat that as the end of a delta chain. In the python
translation layer code we turned this into a Key of ("", nullid) when it
should've been (filename, nullid). This broke a test.
Reviewed By: phillco, quark-zju
Differential Revision: D8768592
fbshipit-source-id: 858a8eadad8699d2e7e99040486f836710381a4f
Summary: This is useful to split dev_command_timer rows based on how many files were rebuilt.
Reviewed By: DurhamG, singhsrb
Differential Revision: D8737307
fbshipit-source-id: 18d52c0fd13184d789daaa8a74f85360554da703
Summary:
This isn't 100% finished and is missing handling some
error cases, but I wanted to put it out there to get some knee-jerk
reactions and suggestions on how to handle some things.
This diff adds a `grep.usebiggrep` config option to `hg grep`. The idea is
that we'll default this to on when the repo requires `eden` (or when we pull in
the eden specific site configuration). When run in big-grep mode, we'll first
ask big grep for the results and then compute the local differences and run
only those through the local grep process, and avoid materializing files
locally.
I'm not 100% sure if the current `repo.status` call will yield the correct
results for the case where the current rev is behind the biggrep
corpus revision.
Reviewed By: quark-zju
Differential Revision: D8416360
fbshipit-source-id: 952badb7a7ec74096b5c77cd79aa25e2327a7659
Summary:
Treedirstate could have `None` _nonnormalset or _otherparentset. Check them
before calling `.clear()`.
Reviewed By: markbt
Differential Revision: D8752216
fbshipit-source-id: 7c72e3a31a405ee2b0464ea08d93b8dd3a187597
Summary:
The recent change from delta.base being a Key to an Option<Key> needed
to update pyrevisionstore as well. I'll add this to buck build soon so we can
catch this.
Reviewed By: phillco, quark-zju
Differential Revision: D8752910
fbshipit-source-id: ecf6d2a8a74b72d10b6dc0fb24c7b9346f0f7ed8
Summary:
The gitignore implementation in core is more complete (support "!" rules)
and efficient (in native Rust). So let's drop the gitignore support in
hggit.
Reviewed By: singhsrb
Differential Revision: D8744807
fbshipit-source-id: faecace0ab0d5a0e015f50473dd1e0c232d013ff
Summary:
Currently many users use hg up to move own commits between the repos because unaware about cloud sync.
The hint will be shown on ambiguous prefix only, so it will not distract anyone.
Reviewed By: markbt
Differential Revision: D8732276
fbshipit-source-id: ae8fa10b28873134da013bc56ff9ebc33e9ed303