Summary:
Adds a test that demonstrates a bug in our ancestor traversal logic.
The test requires very particular circumstances:
Assuming a file x was modified to x' then renamed to z:
1. The rename is required because the bug is in keeping track of the copy source name
2. Version x' must be in the same pack as version z, because the bug is in the
logic that traverses a single packs history.
3. Version x must be in a different pack than x' and z, because the bug is about
trying to look up version x after having lost track of the correct name when
going from z to z'.
4. We must be using rust historypacks, because that implementation attempts to
traverse the entire history within the pack, while the python implementation
stops at renames.
Reviewed By: kulshrax
Differential Revision: D13332458
fbshipit-source-id: b01d09fb8ebd27414e4f6dba06a6d0b1f26ac13c
Summary:
Oculus wants to preserve the "do not show binary diff" config while running
`hg export` in automation, since printing the binary diff might just OOM the
container. Let's add a plain exception for it.
Reviewed By: zhh95
Differential Revision: D13111212
fbshipit-source-id: 34af58ac0917de3b3231e637774896d882585e26
Summary: As the title. To help decide the right way for D13332653.
Reviewed By: DurhamG
Differential Revision: D13333157
fbshipit-source-id: 4fe44fffa48409e790efc1ba7b0d681350512eac
Summary:
We've seen corrupted repository in the wild on which we were unable to garbage
collect. Let's add a test to verify that the other repositories will be garbage
collected.
Reviewed By: DurhamG
Differential Revision: D13328487
fbshipit-source-id: 6f6a69d14455d00e468c5b9186d65cca8fd5c1c3
Summary:
In a future diff we want pushrebase to be able to rewrite commits
pulled from svn. In that situation, we need to be able to rewrite the svn
metadata so that the post-pushrebase commits are mapped to the svn rev numbers.
Let's add a truncatemeta command that will walk the latest commits in the
changelog and redo any that aren't mapped correctly.
Reviewed By: markbt
Differential Revision: D13074960
fbshipit-source-id: fe98879dd16cc0806d20ef6eab5f9d77f0e0c877
Summary:
D13267528 malformed the bookmark store files for testing by deleting a
random file. This makes the test flaky since sometimes a non critical file is
deleted and the exception is not raised. Therefore, lets malform the store more
reliably by truncating all the files in the store.
Reviewed By: ikostia
Differential Revision: D13271362
fbshipit-source-id: 684ffbcdc59e943476a6acc2c4152bf65cc12e1f
Summary:
Importing anything from python files with explicit breaks embedded
aproach we use on Windows.
For one of the tests, I did add `hg debugshell -c "from hgext import sparse;
print sparse.__file__` just to make sure the same file is used in practice.
Reviewed By: singhsrb
Differential Revision: D13258984
fbshipit-source-id: 4c86e1dccfd4f525a14019dc4b9586d798f2bffe
Summary:
D13133605 changed the python bookmark store API and broke the tests.
To fix, I have migrated the tests to use the new API. Also, since most of the
tests was just python code, I have moved the test from being a `.t` test to a
`.py` test.
Reviewed By: quark-zju
Differential Revision: D13267528
fbshipit-source-id: 69b5a7110f63ea60e1bac402064edbffbf64420f
Summary:
If full is specified, or the maxage config option changes from one sync to
another, we need to actually pull in the new commits. Since the version number
won't necessarily have changed, we need to request a full copy of the cloud
workspace to work from.
Reviewed By: liubov-dmitrieva
Differential Revision: D13214274
fbshipit-source-id: b21594c04c05f065caf9f9dc494e6274debbde5c
Summary:
Stop comparing the local heads and bookmarks with the full cloud heads and
bookmarks when some heads or bookmarks have been omitted. Since they're
omitted, they won't be there.
Reviewed By: liubov-dmitrieva
Differential Revision: D13214275
fbshipit-source-id: 35a897f053f58d0793d384ff60b8202e80aec0c7
Summary: Since we are using `hg.rust` with everything, we should also test it.
Differential Revision: D13121588
fbshipit-source-id: 3a4e07c1d70c279f008812d026bf9a7c74aa3b2e
Summary:
This had a nasty bug where it manually computed the cached base text
using the full manifest text. When operating in a treeonly repository, this
resulted in corrupt deltas. The only reason we didn't hit it earlier is because
the secondary stackpush path was added and doesn't have this issue. But it
couldn't handle merge commits, which is why we hit this when it came time to add
a merge commit.
Now that the main repo that needed this optimization is treeonly, we don't need
this precaching anymore.
Reviewed By: mitrandir77
Differential Revision: D13154342
fbshipit-source-id: 5cb74167665a60a36e4a6d926f3f9f1c5c7bbef1
Summary:
There's a corruption that occurs because pushrebase caches a fulltext
instead of a tree. Let's write a test to expose it. The next diff will fix it.
Reviewed By: mitrandir77
Differential Revision: D13154341
fbshipit-source-id: e2ac040c59c677b414b6eddd39d7dc2ebb25f082
Summary:
Fix tests.
This makes sure that the grep process itself is not matched.
Reviewed By: farnz
Differential Revision: D13138516
fbshipit-source-id: d29829584c6fe34dd60345b2812682d4cb9d51e4
Summary:
When we have omitted syncing commits from the cloud workspace, give the user
advice on what to do to fetch them if they run `hg sl --all`.
Reviewed By: markbt
Differential Revision: D13085505
fbshipit-source-id: 624ce6cbf4cb2194ab5ffbc09c1ac3e073932249
Summary: Now that `chg` is embedded into `hg.rust`, we need to explicitly disable it while tests run.
Reviewed By: quark-zju
Differential Revision: D13021560
fbshipit-source-id: 843045f3bc9d9866e421f0bf0aa132849e5b338f
Summary:
Add "--dry-run" for fix-code.py and use it in test-check.
This avoids license header and version = "*" issues.
Reviewed By: ikostia
Differential Revision: D10213070
fbshipit-source-id: 9fdd49ead3dfcecf292d5f42c028f20e5dde65d3
Summary:
Add a new config option: `commitcloud.max_sync_age`. When set, commit cloud
will not pull in any commits that are older than this when it is joining or
syncing. The commits are still nominally in the cloud workspace, we just
save join or sync time by not including the commits.
Reviewed By: liubov-dmitrieva
Differential Revision: D13062470
fbshipit-source-id: 17a4bdb4095766a83a4bf6d4151ae86b39edf59c
Summary:
tweakdefaults used to do this if configured.
After dicussion with the team, we decided that returning 1 was not a helpful design decision, so we're going to fold this in here and everywhere.
Reviewed By: singhsrb
Differential Revision: D13050548
fbshipit-source-id: 66e834ea503e4b1339e369495a9729b951024a6d
Summary:
This allows us to expose `arc pull`'s functionality directly from hg.
There are three parts:
- Create a revset that runs a program, reads the stdout and looks up that commit if it exists
- Auto-pulling if the commit doesn't exist
- Supporting an optional argument (target) that's passed to the script
Reviewed By: DurhamG
Differential Revision: D10524541
fbshipit-source-id: 7493c5592e272f9e8a87f109cec1426d44935ecc
Summary:
We need to record updated onto rev instead of guessing it in pushrebase replayer.
I will not land this diff until mononoke db schema is update D12923144, D12997125
Reviewed By: quark-zju
Differential Revision: D12922833
fbshipit-source-id: 11c6411c392ca9092be53ffba8baa074faf3a996
Summary:
Previously, if we were writing local data to pack files we weren't able
to read that data until the pack file had been flushed. Let's add those mutable
packs to the union store so we can see there data.
This is important for unblocking use of hggit and hgsubversion since they may
import many dependent commits in a single transaction.
Reviewed By: quark-zju
Differential Revision: D12959497
fbshipit-source-id: 405c0c5c1e8fc84bc8ffef827a84e91d57eb95d8
Summary:
The config to write local packs has an issue with reading data from
currently pending mutable packs. Let's add a test demonstrating this, and in the
next diff we'll fix it.
Reviewed By: quark-zju
Differential Revision: D12959501
fbshipit-source-id: 5bcb278ccb977cea83e8cd594a404816d4f8f1fa
Summary: Jellyfish uses `hg debugcrdump` to get commit data, including binary files. Now we want in jf to be able avoid dumping binary files, so I added `--nobinary` option to crdump
Reviewed By: quark-zju
Differential Revision: D12981968
fbshipit-source-id: 669ef4cf8f6225b911f5085c1a47fb7242f259bf
Summary:
`@@ -1,1 +-1,0 @@` is not a valid patch hunk header.
Change it to `@@ -1,1 +0,0 @@`.
This is a backport of my upstream patch https://phab.mercurial-scm.org/D3737
Reviewed By: singhsrb
Differential Revision: D12970975
fbshipit-source-id: eb769e93076efc932a8c4be7387ba21933aae331
Summary: Updated the global help summaries that are displayed for each command when you run 'hg help' and fixed corresponding tests
Reviewed By: markbt, kulshrax
Differential Revision: D12832280
fbshipit-source-id: 950dad1c805feab573d7d0182da523ae12299d3b
Summary:
Our `rename` is not atomic:
```
def rename(src, dst):
"""Rename file src to dst, replacing dst if it exists"""
try:
os.rename(src, dst)
except OSError as e:
if e.errno != errno.EEXIST:
raise
unlink(dst)
# What if the process is interrupted here?
os.rename(src, dst)
```
However, the `MoveFileEx` Windows API provides a way to to
replace the existing file, thus eliminating the need to do `unlink`.
Unfortunately, it only works for files, not for dirs, therefore
we're introducing a new file-specific rename function.
Differential Revision: D12940555
fbshipit-source-id: a6749a9b16a285788de0f5c06d51a15c919166ce
Summary:
If the commits being pushrebased don't actually need to be rebased, pushrebase
will accept them like a normal push. In this case we shouldn't prevent them
from be changed to public commits on the client.
Track this by detecting whether we receive a changegroup part from the server.
If we do, only the commits that are marked as replaced with obsmarkers (if
enabled) can be marked as public.
Reviewed By: quark-zju
Differential Revision: D12944851
fbshipit-source-id: 44f8fc17b36397d949cba5d3e787fad813bab4ea
Summary:
When pushrebase is enabled, pushing a commit that doesn't result in any
rebasing action acts like a normal push (the commit is not modifed and a new
hash is not returned), however the phase update doesn't apply, so the commit
remains draft.
Reviewed By: quark-zju
Differential Revision: D12944850
fbshipit-source-id: 2145d9b7eebc27bfdff34544e73802c13f30dbd2
Summary:
D12888964 added the capability for `svnrev` revsets to be
interoperable with the `globalrev` revsets. This commit adds the tests for it.
Reviewed By: quark-zju
Differential Revision: D12888960
fbshipit-source-id: 07b12632d534a329c32179e978b058b1e427e688
Summary:
The capturing UI is not required as we can use the much cleaner
`ui.pushbuffer`/`ui.popbuffer` for the intended purpose.
Reviewed By: quark-zju
Differential Revision: D12906912
fbshipit-source-id: ae93e6417135ca23b28a11af63745464344fa3cf
Summary:
This method always prints the graph for the commits in the repository.
This commit adds supports for specifying any revset as input for the log and
also, makes printing the graph optional.
Reviewed By: quark-zju
Differential Revision: D12888965
fbshipit-source-id: 794606fa17f9836fd73675d36d11220b11994f41
Summary: The `svnrev` is more useful than the `rev` in this context.
Reviewed By: quark-zju
Differential Revision: D12888963
fbshipit-source-id: a902c57ecc3bc3eca9da77ab6e14ef58512d5ad8
Summary:
This is required for testing `globalrevs` integration with
`hgsubversion`. In particular, we will test out whether we can resolve
`r<svnrev>/r<globalrev>` correctly later. Seems like this configuration should
be on during all the tests because it is the configuration we use in
production. Therefore, this commit in resolves revset string with prefix `r`
for all the `hgsubversion` tests.
Reviewed By: quark-zju
Differential Revision: D12888961
fbshipit-source-id: af9b2e1aea9771f42fe1fb2d3f9a759a926b1ce3
Summary:
We need a configuration option for specifying the starting revision
beyond which we will consider the global revisions associated with the commit
valid for the following reasons:
- It lets us have the flexibility to support `globalrevs` from a commit of our
choice.
- We need this configuration to decide when we should fallback to looking at
the `svnrev` instead of the `globalrev`.
Reviewed By: quark-zju
Differential Revision: D12888966
fbshipit-source-id: 46d6314886ed5074edb537ba340d5606ec354619
Summary:
It turns out data packs contain the exact mercurial file blob,
including the rename metadata header. This is different from how loose files work, which
contain the non-headered text and instead store the rename in the history at the
end of the file.
Ideally we'd change datapacks to not store the metadata version of the file, but
unfortunately this is how it has always been, so instead we must change the
commit-straight-to-pack code to write the headered blob.
Differential Revision: D12936247
fbshipit-source-id: 3f909d2964d7f7200ac0e31e47bd195b0c9b03e5
Summary: Not all of the repos are remotefilellog, so I moved some invocagions of the content store to shallowrepo and added requirements check where the transaction is processsed in localrepo
Reviewed By: quark-zju
Differential Revision: D12881916
fbshipit-source-id: 1119debd1e3d42cdf9513a6cae4bad4c000cc046
Summary:
Based on discussions about the best approach for solving the amend message
problem, back out the template previously added. We will use a different
approach.
Reviewed By: mitrandir77, liubov-dmitrieva
Differential Revision: D12921753
fbshipit-source-id: ca760ffe14bfe473b7526a1b84a8cfc6b0257bf2
Summary:
It turns out tracking ignored files does have an impact on status performance.
Filtering out the ignored directories is not that fast, and ignored files can
be scattered everywhere (like ".pyc", ".iml" files) that makes them harder to
be filtered out efficiently.
Add code paths to migrate between "ignored tracked" and "ignore untracked".
Store the metadata in treestate.
Reviewed By: phillco
Differential Revision: D12916021
fbshipit-source-id: e02d0c6f3b1a036f70703c11f35381c594e2f8e5
Summary: This is to replace `debugstate -v`. The latter does ont list untracked files.
Reviewed By: DurhamG
Differential Revision: D12906649
fbshipit-source-id: b84f41dfadff4932c0ddd48480a4aa03db88cab0
Summary: We'd like to identify which of the three underlying conditions cases this exception.
Reviewed By: quark-zju
Differential Revision: D12870572
fbshipit-source-id: 45724ad6bb3582c04a6ea3c0b7a748bf72219b93
Summary:
This test is broken after D12849852 because the grep outputs the files
in different order during multiple test runs. Let's fix it by sorting the
output from the command.
Reviewed By: phillco
Differential Revision: D12869810
fbshipit-source-id: 49073e83e926e94db5f0bd290d74845ebfde0bb6
Summary: This is nicer for the user and makes the test not be flakey.
Reviewed By: quark-zju
Differential Revision: D12860852
fbshipit-source-id: 6ccb0ca679dc25a80730e83a26a39dd3becb5c8f
Summary: This fixes the "hg prev" targetting the first commit in the repo. The problem was the rev `0` which casted to false in all the checks.
Reviewed By: phillco
Differential Revision: D12840237
fbshipit-source-id: 594a2725fa125ee713f347379c875ec54b80a53d
Summary:
This brings the config closer to what we use and uncovers some problems with
disallowemptyupdate itself.
Reviewed By: phillco
Differential Revision: D12840239
fbshipit-source-id: 77740b79114c7d901b0181e0e425aea4e9c7c570