Summary: This mitigates loading order issues demonstrated by the previous diff.
Reviewed By: DurhamG
Differential Revision: D21148446
fbshipit-source-id: 40e4861055822b4676f3ac38d0f004b365efe86d
Summary: Demonstrate that bookmark loading order can cause "unknown name" errors.
Reviewed By: DurhamG
Differential Revision: D21148445
fbshipit-source-id: d12417ad150904bda14df47cb6e9fe464f392588
Summary:
When comparing empty file with file with content our xdiff wrongly included
warning about missing newline, which also made the line counter in the hunk
header off-by-one.
Empty files are quite rare in our repos, that's why I discovered this bug only
now (it broke phabricator parsing of this single commit).
Reviewed By: markedson1024
Differential Revision: D21141341
fbshipit-source-id: 9d3e0d8a61ac4ee2cf27978b99b3a092259ee186
Summary:
We don't use ssl to connect to myrouter, and the fact that we even try
causes things to break because we don't have ssl certs.
Reviewed By: sfilipco
Differential Revision: D21139692
fbshipit-source-id: 4a53de929f0114e4307276b8feffcaafebc5d5ce
Summary:
Ideally, either the ContentStore, or the upper layer should verify that we
haven't missed uploading a blob, which could lead to weird behavior down the
line. For now, all the stores will return the keys of the blobs that weren't
uploaded, which allows us to return these keys to Python.
Reviewed By: DurhamG
Differential Revision: D21103998
fbshipit-source-id: 5bab0bbec32244291c65a07aa2a13aec344e715e
Summary:
When a file goes from being a symlink to a regular file, a regular update
action ("g") is used, and the Python code implicitely remove the symlink before
writing to it. In the Rust code, we don't and as a consequence write through
the symlink, not the intended behavior.
An alternative way of fixing this would be to perform an lstat(2) before
writing to a file, but the cost of doing that will be fairly high for a very
unlikely situation especially since the manifest diff can give us exactly this
information.
This whole merge code feels extremely fragile, so I'm definitively not sure if
I got all the places that needs updating :(.
Reviewed By: DurhamG
Differential Revision: D21082733
fbshipit-source-id: 4f36a67363915c9b67d5a0b290a226075a9f1d31
Summary:
We'll be adding more data to the filesystem layer, so let's move this
out of lib.rs.
Also made a slight tweak to expose File metadata in the walk results, which will be used by the future pending changes logic to avoid re-stating the file.
Reviewed By: xavierd
Differential Revision: D20546903
fbshipit-source-id: 70456055b0da601990e6d6ff535678d2df6c50ba
Summary:
Purging treemanifest packfiles always made little sense to me, as the reason we
have tons of them, is because we fetched tons of them. Remove all of them would
just lead to the same situation again. Let's just do a repack instead.
Reviewed By: markbt
Differential Revision: D21065723
fbshipit-source-id: a7cdee1de1d7897481f75c13d8aceeb8c1a68550
Summary:
Now that we've upgraded mysql-connector-python, we can enable these
tests.
Reviewed By: quark-zju
Differential Revision: D21009185
fbshipit-source-id: e9ae62cadcc8d0a291381ab2cfb5c7bc04606d9e
Summary:
Previously, an extension adding the "changeset" pushop might forget to call the
prepushoutgoing hooks, preventing them from being called.
Reviewed By: DurhamG
Differential Revision: D21008487
fbshipit-source-id: a6bc506c7e1695854aca3d3b2cd118ef1c390c52
Summary:
Sometimes due to wrong configuration, branches that are not relevant to the
user become visible. Detect that and provide a way to hide them.
Reviewed By: xavierd
Differential Revision: D21055464
fbshipit-source-id: 19da498a137fdd08e363d6f689b6de31bc884dbd
Summary:
Sometimes due to wrong configuration, cloud sync or legacy pull without
selectivepull will pollute the remote bookmark namespace with too many remote
bookmarks. Detect that and provide a way to reset remotenames to selected
bookmarks.
Reviewed By: xavierd
Differential Revision: D21055466
fbshipit-source-id: f96c6ba79dd8646fa017947e48e80259ed77de67
Summary:
This is rare. But if visibleheads has a broken header, attempt to fix instead
of skipping.
Reviewed By: xavierd
Differential Revision: D21055468
fbshipit-source-id: 8907c84b69eadb50afae1940862db01a926a38f5
Summary: Trigger a `hg pull` if the remote bookmark appears to be lagging.
Reviewed By: xavierd
Differential Revision: D21055465
fbshipit-source-id: e5ea33ca15f50b504368bec0f349a4abe895eee0
Summary:
It was for preventing undocumented configs. Practically it does not achieve the
goal and we might prefer not documenting some of the advanced features to reduce
support burden of unusual configs. Therefore remove it.
We can revisit once we want to improve the documentation of the product.
Reviewed By: xavierd
Differential Revision: D21055469
fbshipit-source-id: 2c26791d2284071b1ac26d1190ec5c4876546f77
Summary:
`obsolete()` alone shouldn't prevent push. Check if a successor in the
destination branch instead.
Reviewed By: DurhamG
Differential Revision: D20911924
fbshipit-source-id: 0f983f3440a5bcff13e1a98b28aac2df80b419e0
Summary:
Change the fork search to always respect GraphQL if possible. This will result
in more deterministic result, and can avoid full changelog scan if the diff
points to public commits.
Reviewed By: DurhamG
Differential Revision: D21045430
fbshipit-source-id: 2e2b13f5aad3670b9018e5c4ce769b330d14531e
Summary:
The local draft scan turns out to be needed by cfgr `jf land` for reasons like
callsign not set (s199694). The whole changelog scan is already slow and will
be slower with segmented changelog so let's log it and see if we can remove it.
Reviewed By: DurhamG
Differential Revision: D21045429
fbshipit-source-id: 999c8479662b3476a09ec852de98cbecebd7f31a
Summary:
The `ui` object is a bit messy - there are repo specific ui, and non-repo ui,
and ui can be copied around.
This diff changes `fout` and `ferr` to an indirect type that can be mutated
globally so the streampager can affect the `fout` and `ferr` of all related `ui`
objects instead of just one single `ui`.
Reviewed By: DurhamG
Differential Revision: D20903568
fbshipit-source-id: b2f139b91a39c20c22261e03ce50f3cc59074291
Summary:
This allows the streampager to be configured via hgrc files.
Default are picked so the behavior is closer to the current default pager
(`less -FRX`).
Reviewed By: DurhamG
Differential Revision: D20902034
fbshipit-source-id: 994ab963ceace02eeb1d18cfa5768e411ca3610b
Summary: This makes it work with chg, since `/dev/tty` is not available for chg.
Reviewed By: DurhamG
Differential Revision: D20936967
fbshipit-source-id: f3ded1aa5552f321ff7043a039f4e35a88160a51
Summary:
The Rust worker code will only work with remotefilelog, and when the Rust
ContentStore is enabled, make sure to not enable it if these 2 conditions
aren't met.
Reviewed By: quark-zju
Differential Revision: D21033428
fbshipit-source-id: c34c1b39ddb81be399463712216fa2cd68771f41
Summary:
Computing delta force the client to have the previous version locally, which it
may not have, forcing a full fetch of the blob, to then compute a delta. Since
delta are a way to save on bandwidth usage, fetching a blob to compute it
negate its benefits.
Reviewed By: DurhamG
Differential Revision: D20999424
fbshipit-source-id: ae958bb71e6a16cfc77f9ccebd82eec00ffda0db
Summary:
We want Mercurial to become more responsible for it's own
configuration, instead of relying on chef and other means. To do so, let's
introduce a new `hg debugdynamicconfig` that can generate dynamic configs for
a given repository based on various states, like what tier it's in or what shard
that machine is in. By default it generates to '.hg/hgrc.dynamic' for the given
repository.
Currently it just sets the hostgroup config.
Future diffs will make Mercurial consume this config, and possibly have Mercurial
call this command asynchronously when it notices the file is out-of-date.
Reviewed By: quark-zju
Differential Revision: D20828132
fbshipit-source-id: 6f5bf749f5b04e0a5989d6dc19ee788c2e47f88f
Summary:
A future diff will want to generate configs programmatically and write
them to a file. Let's add write support to ConfigSet.
Reviewed By: quark-zju
Differential Revision: D20828133
fbshipit-source-id: 702f6f9bdfdf99ef25c6e1c0ab33373a4b6508fe
Summary: D21017515 removed the `since-last-arc-diff` flag; this was the last reference to it in the hg codebase.
Reviewed By: singhsrb
Differential Revision: D21025752
fbshipit-source-id: 083cb821263fa844ec74773d8636e19a6e82c550
Summary:
I noticed we removed the call to getManifestEntry, but didn't remove
the method from the EdenThriftClient.
Reviewed By: singhsrb
Differential Revision: D21025523
fbshipit-source-id: 409eb52bad08b305ecfd0f8918cb71fec6a71aab
Summary:
This flag is an obsolete duplicate of since-last-submit.
Eliminate it to facilitate convenient tab autocompletion and make
the world less complicated.
Reviewed By: xavierd
Differential Revision: D21017515
fbshipit-source-id: f3e4db602a69f1c7da886d455ac36c4a2ddb6b01
Summary:
The revisionstore is a large crate with many dependencies, split out the types part which is most likely to be shared between different pieces of eden/mononoke infrastructure.
With this split it was easy to get eden/mononoke/mercurial/bundles
Reviewed By: farnz
Differential Revision: D20869220
fbshipit-source-id: e9ee4144e7f6250af44802e43221a5b6521d965d
Summary: Since the old Edenfs warning is usually for simply picking up new eden releases, we can suggest the user runs a graceful restart instead of a normal restart to avoid them running into `Transport not connected` errors. This path is only hit in unix environments, so windows users will not see this (since graceful restart isn't supported there yet). Since this is a manual step as well, it will be easier for a user to see if they run into an issue here. This can also enable us to get more telemetry from users running graceful restarts.
Reviewed By: wez
Differential Revision: D20901597
fbshipit-source-id: 9e5c9a90313901be159f66afcbbadc5d7af4fe28
Summary:
Having some colors, even dull is better than no colors. For every "bright"
color found in the repo, also specify their non-bright variant.
Reviewed By: DurhamG
Differential Revision: D20972198
fbshipit-source-id: ca10c0eac13129f120fc45623d134f279a75b3c2
Summary: We're writing utf-8 data to it, decode it before returning it.
Reviewed By: DurhamG
Differential Revision: D20972741
fbshipit-source-id: fb23a6d1c3188e10598b839639cdd5e74322089a
Summary:
While keys are strings, values are bytes buffer and thus needs to be converted
sometimes.
Reviewed By: DurhamG
Differential Revision: D20974484
fbshipit-source-id: 13394f5dc43191e85e4b1d350cc4fbbd8489572a
Summary:
Symlinks are pointers to path, that are required to be utf-8, thus we can
decode the data.
Reviewed By: DurhamG
Differential Revision: D20973701
fbshipit-source-id: 8399dfb3462fea907758a01ed2fcea508833fbaa
Summary:
With the upgraded git, some error message aren't the same as before, update the
test to reflect that.
Reviewed By: quark-zju
Differential Revision: D20993735
fbshipit-source-id: d9b8bfc9c6d10f7c0898299659e4322589ea8077
Summary: `hyperlink(url, title)` returns a terminal escape sequence for the url even if the title provided is empty. While the terminal displays nothing, the actual string in hg-template-land is non-empty (it contains a url), and all the template functions that check for empty strings don't see it as empty.
Reviewed By: fanzeyi, xavierd
Differential Revision: D20970733
fbshipit-source-id: 04436714f3827b98b8fb249b3eb1da82f366807c
Summary: In Python3, str is not a byte string, but a unicode one. Use bytes instead.
Reviewed By: sfilipco
Differential Revision: D20965794
fbshipit-source-id: b04ff004aac87fd3afc8070fc8d1d849ad48d0d3
Summary:
In order to grep, the body of the file is decoded to utf8 with the error
handling "replace". This is probably OK as I would expect histgrep to be used
on text files, not random binary ones where grepping would probably not make a
lot of sense.
Reviewed By: sfilipco
Differential Revision: D20965178
fbshipit-source-id: 9ba234f33e801a78537c22b61dee434625449c01
Summary: The file is already written with writeutf8, read should use readutf8 too.
Reviewed By: sfilipco
Differential Revision: D20949694
fbshipit-source-id: cb00f45313ba8f78197d2344db7adc787b13ee4d
Summary:
Dulwich expects pretty much everything to be bytes, thus we have to convert a
lot of stuff to bytes from unicode. This only fixes one test, but makes
progress on all of them.
Reviewed By: sfilipco
Differential Revision: D20949172
fbshipit-source-id: 44cd0c5136b3d224f7eb81e48ec98fed60c8b390
Summary: The output was added in a recent git release, update the test to reflect that.
Reviewed By: DurhamG
Differential Revision: D20968427
fbshipit-source-id: 7fed6232723151adefe8329d8a98a314f04f222e
Summary: Not sure what fixed them, but now they pass.
Reviewed By: xavierd
Differential Revision: D20933992
fbshipit-source-id: ece47486df17fd5d9303a98bc3b63a429972e73f
Summary:
These classes were used for upstream's treemanifest implementation. At
one point we partially used it for our server side tree logic, but these days we
don't use any of it except for the revlog layer. Let's delete the context and
treemanifest layers and tests.
Reviewed By: sfilipco
Differential Revision: D20953163
fbshipit-source-id: 952063e4e0cf74e2da740bf91a70e1714a9ad9b5
Summary:
Disables 'hg serve' being able to start a web server. This can be
worked around temporarily by setting web.allowhgweb=True, but we should remove
that workaround soon so we can deleted all the code.
Reviewed By: xavierd
Differential Revision: D20951800
fbshipit-source-id: e0d5017647a073b5ede3b0bbc4dd745fabeac816
Summary: The .keys() in Python3 returns an iterator, hence '+' doesn't work on these.
Reviewed By: quark-zju
Differential Revision: D20956491
fbshipit-source-id: 15c74bfcfe6d27dff5018fdf71e61bb747daf2d8
Summary:
The iteritems method doesn't exist in Python3, add the items one and remove the
pycompat.itermitems wherever we iterate over the lazyremotenamedict.
Reviewed By: quark-zju
Differential Revision: D20926027
fbshipit-source-id: de9d297126e8190f008cb5d09cc5a128d68c2213
Summary: The test is less relevant as our entry point is now in Rust (and via bindings).
Reviewed By: xavierd
Differential Revision: D20953331
fbshipit-source-id: 0f80befb761d81389924bee23a683d9fb05d13db
Summary:
Drop other diffhelpers implementations.
The Rust implementation does a better job on type checks and won't segfault.
Reviewed By: xavierd
Differential Revision: D20935367
fbshipit-source-id: f59240f3a661efe1ca6e451922bcb3ca6ee6ae22
Summary:
The diffhelpers.c lacks of type checks and segfaults on Python 3:
(gdb) r --config patch.eol=auto import -d '0 0' -m 'test patch.eol' --bypass ../test.diff --debug --traceback
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7263016 in __strcmp_sse42 () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff7263016 in __strcmp_sse42 () from /lib64/libc.so.6
#1 0x00007fffee5e3d3b in testhunk (self=<optimized out>, args=<optimized out>) at edenscm/mercurial/cext/diffhelpers.c:151
Looking at the diffhelpers usage, it seems to be using the `bytes` type
(bytes on Python 2, str on Python 3). Let's implement it in Rust so `rust-cpython`
will complain if the type is not `bytes`.
Reviewed By: xavierd
Differential Revision: D20935366
fbshipit-source-id: 8b474555b52caeab4175d7dad44c4c4e7097e557
Summary:
This largely reverts the changes in D9443604, to make `hg rage` report the
full configs again.
Our configs vary from tier to tier and repository to repository. The override
settings alone don't seem like enough to try and figure out what the actual
settings are that the user is using.
I retained the behavior of reporting the source file and line number for each
config item, which wasn't present before D9443604. I also still excluded
config values from the "builtin" config source. Currently this only excludes
the handful of merge-tools defined in
`eden/scm/edenscmnative/bindings/modules/pyconfigparser/src/lib.rs`
Reviewed By: quark-zju
Differential Revision: D20927599
fbshipit-source-id: 8b5b5bf8b7871b85bd0fe5cd179f16693e4fbb2a
Summary: The binhunk is for binary data, therefore we need to use byte strings.
Reviewed By: xavierd
Differential Revision: D20290069
fbshipit-source-id: 9cd763b76df389a1f7b65aecf0be4aa36a85cf91
Summary:
On python3, no need to replace stdin/stdout with a bytes based one, keep them
as is.
Reviewed By: xavierd
Differential Revision: D20290068
fbshipit-source-id: b10b69185a52c79e7c67f69f6a8a96937c64a550
Summary: The .encode('hex') isn't available in Python3, codecs.encode needs to be used.
Reviewed By: DurhamG
Differential Revision: D20927989
fbshipit-source-id: cd0ecdbcbf0ab6391b37f44e7b38a3ffabf91340
Summary:
Not sure if this is the proper solution, but the template engine refuse to work
with anything but utf8 strings, but the diff operation only work on bytes.
Let's convert the return of diff to utf-8.
Reviewed By: DurhamG
Differential Revision: D20927680
fbshipit-source-id: 25c2947cac417448ca3521c2d5478fa8eebef04f
Summary:
In Python3, the error returned from binascii.unhexlify changed, from a generic
TypeError to a binascii.Error. Therefore, wrap the binascii function and catch
the binascii.Error before raising a TypeError.
Reviewed By: DurhamG
Differential Revision: D20924129
fbshipit-source-id: 33f852ea97396af715ef73630e0dd1b4324eb707
Summary:
I can't say that I understand `mdiff.splitnewlines`. In my test it does not
behave the way it reads and I don't know why. The stripping that it's supposed
to do doesn't happen for some reason. It behaves like splitlines.
I believe that rcutil used '\n' for line termination because it was relying on
Python to do the conversion to system line end. I updated to use os.linesep
now that we encode the contents.
Reviewed By: quark-zju
Differential Revision: D20935377
fbshipit-source-id: 0958fdff03950ab0a4b2da02e4333b5438ac5c70
Summary:
Bytes and Str usages mostly. __iter__ seems to have been incorrectly
converted to python 3 previously.
Reviewed By: xavierd
Differential Revision: D20933166
fbshipit-source-id: 10e63e90bd83c70a51dd808e9b5073ab8d766e71
Summary: We should read/write to it via as utf8.
Reviewed By: DurhamG
Differential Revision: D20923404
fbshipit-source-id: 86cdc329395d60c88637f24d3c7c5caedcc7111a
Summary:
Sometimes the Rust io::Error is generated without an errno (ex. pipe
0.2 would generate BrokenPipe error without an errno). The Python
land uses errno to check error type (Python does not have io::ErrorKind).
Therefore attempt to translate ErrorKind to Python errno. Without this
exiting the rust pager early would crash like:
StdioError: [Errno None] pipe reader has been dropped
abort: pipe reader has been dropped
Reviewed By: markbt
Differential Revision: D20898559
fbshipit-source-id: ef863617e0e500d878ea0f9aeac06b4d87ffbcf2
Summary:
The computation of commit obsolescence is inconsistent. If we compute the full
set of obsolete commits in `mutation.obsoletecache.obsoletenodes`, then we
correctly ignore public commits as they cannot be obsolete.
However, if we compute the obsolescence state for a single public commit with
`mutation.obsoletecache.isobsolete`, and that commit somehow has a visible
successor, then we will incorrectly consider the commit as obsolete.
Similarly, `allpredecessors` and `allsuccessors` should stop when they hit a
public commit.
Reviewed By: quark-zju
Differential Revision: D20892778
fbshipit-source-id: 223cb8b2bc9f2f08124df6ff51c2eb208bb8eb5f
Summary: This makes the tracing features easier to use.
Reviewed By: DurhamG
Differential Revision: D19797703
fbshipit-source-id: fb5cb17cd389575cf0134a708bcd9df3b90e9ab4
Summary:
Somehow, enabling VT can fail when writing to the pager, but this doesn't
mean that the pager doesn't support VT mode, so let's just ignore the error
when the pager is active.
Reviewed By: DurhamG
Differential Revision: D20906374
fbshipit-source-id: 7cba52817bc8e4dc91d5d50e856ad8af7fc9542c
Summary: Print out a command that can be copied and executed to make `--keeptmp` more handy.
Reviewed By: sfilipco
Differential Revision: D20829140
fbshipit-source-id: 7976e3f64fd423425ec29634a53a34f7b5e091d0
Summary:
Add a command to print visibleheads. This was part of my attempt to check if
visibleheads can accidentally include public commits and if there are a way
to remove it. I ended up thinking D20808884 might actualy solve the only case
that visibleheads include public heads.
I also tried to add strong verification so that the visibility layer never
writes public nodes. That's for non-narrow-heads use-cases. However, the
phasescache + repoview layer is kind of messy in a way that inside a
transaction there is only one "repo" that has the right in-memory, dirty
"phasescache" and other repos will load the (stale, wrong) phasescache from
disk. That means if we test phases in visibility before transaction flushes,
we won't be able to access the latest phases information correctly. So I
gave up this approach too.
Anyway, I wasn't able to add a new interesting test, but the utility built for
the test seems useful. Therefore this change.
Reviewed By: sfilipco
Differential Revision: D20829136
fbshipit-source-id: 5ebafefac820ebb4044db63b7892ffaa341c0573
Summary:
Make the error cleaner and more actionable. We don't autopull the commit
because the revset layer might be not ready for it (ex. it expects commit
graph to be immutable and might have done some calculations based on the
old graph already).
Reviewed By: sfilipco
Differential Revision: D20845159
fbshipit-source-id: c51f2f52c612ff14a88fb891c10d1faad1094635
Summary: This makes it easier to reason about.
Reviewed By: sfilipco
Differential Revision: D20845158
fbshipit-source-id: 4220c7790a2d3bb83380b65d3de469b42846b34d
Summary:
The old linear changelog search does not scale and does not work with segmented
changelog, which makes commit data lazy. The "forksearch" is also problematic as
it can produce non-deterministic results. Let's disable the linear search by
default with the intention to remove it if nobody complains.
Reviewed By: sfilipco
Differential Revision: D20845161
fbshipit-source-id: 6911035f146e15c88925217ee9940db59ea2d1c1
Summary:
The manifest node is hard for debugging. Attach the commit as the context and
print it out.
Reviewed By: sfilipco
Differential Revision: D20829139
fbshipit-source-id: ff65d902f56bc79c2d5f2c3ec9cf79a620fd70fc
Summary:
This allows providing context about errors, similar to Rust's "context"
features.
Reviewed By: sfilipco
Differential Revision: D20845160
fbshipit-source-id: 789a4c1b7356fd6eb4b1bcb71efd205d2d45e984
Summary:
On upload, read all the local blobs and upload them to the LFS server. This is
necessary to support `hg push` or `hg cloud sync` for local LFS blobs.
One of the change made here is to switch from having the batch method return an
Iterator to having them take a callback. This made it easier to write the gut
of the batch implementation in a more generic way.
A future change will also take care of moving local blobs to the shared store
after upload.
Reviewed By: DurhamG
Differential Revision: D20843136
fbshipit-source-id: 92d34a0971263829ff58e137e9905b527e18358d
Summary: This method will be used to upload local LFS blobs to the LFS server.
Reviewed By: DurhamG
Differential Revision: D20843137
fbshipit-source-id: 33a331c42687c47442189ee329da33cb5ce4d376
Summary:
Loose files makes it easier to interact with a Mercurial server for tests, use
it instead of an IndexedLog.
Reviewed By: DurhamG
Differential Revision: D20786432
fbshipit-source-id: 61c1fc601d9a6ed157c5add9748e40840b081870
Summary:
This exposes the Rust's pager to Python. Right now it's using the system
terminal.
Reviewed By: DurhamG
Differential Revision: D20887174
fbshipit-source-id: c72f31a58475e76f8097c515dd29f911d2ac4df1
Summary:
Do not convert the entire output to a string. This makes `debugindexedlog dump`
a good test case for native pager support - it takes a while to write the full
output for a large input.
Reviewed By: DurhamG
Differential Revision: D20885567
fbshipit-source-id: 35ed8f68dff1916f0833577c3cf2a52cbf2a658c
Summary:
Implement the core API to start pager in native Rust. For now it is only
enabled for the entire command if `--pager=always` is set.
Reviewed By: DurhamG
Differential Revision: D20849644
fbshipit-source-id: 860b4e18d841da607864c3447d78dbac126f5f18
Summary: The template should use mutation instead of obsutil if mutation is enabled.
Reviewed By: markbt, simpkins
Differential Revision: D20901109
fbshipit-source-id: a2b587ddf2a03965886f753e54e075d5d9064f05
Summary:
Old is defined by being based on a commit that is more than 30 days old.
The build date is taken from the version string.
One observation is that if we fail to release in more than 30 days then all
users will start seeing this message without any way of turning it off. Doesn't
seem worth while to add a config for silencing it though.
Reviewed By: quark-zju
Differential Revision: D20825399
fbshipit-source-id: f97518031bbda5e2c49226f3df634c5b80651c5b
Summary:
When syncing, if the local copy of the remote bookmark is `None` then the
remote bookmark has been deleted, and shouldn't be added to the set of new
remote bookmarks.
Reviewed By: DurhamG
Differential Revision: D20855909
fbshipit-source-id: 84a7a78ec0ab179e4a14d946b37f496f3dbde03a
Summary:
When falling back to convert_revision to get the svnrev for a commit to return
it as a globalrev, it seems like it would make sense to verify that the
convert_revision is indeed a svnrev (and not, say, a git commit hash from
hggit).
Reviewed By: farnz
Differential Revision: D20891268
fbshipit-source-id: 2451ad787fcce7b10b6a405f2855313ca51f5b3e
Summary:
Use modern utilities for this test. This makes the setup portion much shorter.
The test content changed a bit as the configuration is changed - both clients
have selectivepull enabled.
Reviewed By: sfilipco
Differential Revision: D20829137
fbshipit-source-id: d2f29d162172e149d7140925e7d3801707484df2
Summary:
This makes writing tests easier.
It was part of D20504732.
Reviewed By: sfilipco
Differential Revision: D20829138
fbshipit-source-id: e9309e099a13d0a509eff707ae229bf8b7a9c231
Summary:
Similar to D19957251, failing to prefetch trees post-pull is not a fatal error.
This recently became an issue because with these conditions:
- We're migrating a repo from hg to Mononoke, and Mononoke has lagged
bookmarks, esp. remote/master.
- We're still using Mercurial to serve infinitepush pulls (ex. scratch
bookmarks). Mercurial will return bookmarks that are not synced to
Mononoke yet.
- I made a recent change (D20531121) that moves selectivepull logic that
changes `pull -r HASH` to `pull -r HASH -B master` to core. The CI
tier didn't have selectivepull enabled that will pull bookmarks, but
now they also pull bookmarks.
- The tree prefetch logic uses unpatched paths.default to fetch `master`,
which can be an unknown commit for Mononoke.
Ideally, the final state is to rely on Mononoke for everything. There is
only `paths.default` which points to Mononoke. For now, as a temporary
fix let's just make post-pull tree prefetch non-fatal. Once this happens,
it will be logged to the cloud table with fatal=false.
Reviewed By: krallin
Differential Revision: D20873599
fbshipit-source-id: 291a2dc41c7c602f004ad8df71e19a48a98e9c5e
Summary:
This makes it easier to spot typos.
The config sparse.missingwarning affects everytime a sparse profile is used.
In this case we just want to check at "enableprofile" time. So avoid using
that config option.
Reviewed By: DurhamG
Differential Revision: D20846313
fbshipit-source-id: 79f80d5e01abfe1633f2597074e9acb5cda60fec
Summary:
Tests are redirected, but we still want colors in them (to verify that ANSI
escape code works). Since VT mode will always fail, simply do not try to
enable it in this case.
Reviewed By: DurhamG
Differential Revision: D20875423
fbshipit-source-id: bd6b0046de9558d957e0df082d4392ad00e0b551
Summary:
Somehow the constant isatty and config reading shows up in my profile. Since
this is not intended to change, just cache it.
Reviewed By: DurhamG
Differential Revision: D20830511
fbshipit-source-id: de36c0a958f6a6046a05db0abf976994435b9e3c
Summary:
The IndexedLog code uses a lock file to lock a directory on Windows, make
sure we account for that.
Reviewed By: DurhamG
Differential Revision: D20818882
fbshipit-source-id: 7e9aa255354d36899ad57168311a4276d448dc07
Summary:
Now that we have a proper back-channel to retry failures in Python, the
failures will be retried at a later time, when the anti-virus would have
hopefully release any locks it has on the file.
Reviewed By: DurhamG
Differential Revision: D20847006
fbshipit-source-id: 4fad0e773f69ddff27a23bc86dbbd3ce47bb3b46
Summary:
For our HgExternalSync jobs that pull from git, we don't really use most of the
bells and whistles of hggit. Notably, we don't care about bookmarks: we only
ever pull master, we never update to it, we only ever look at `-r tip`.
However, we do care about things that are actually much harder to fit in a
world where we try to pretend the remote git repository is actually a hg
repository we can pull from.
Notably, we'd like to enforce limits on how many commits we pull (and convert)
at a time, so that if we fall behind a little bit, we don't start falling even
more behind by having to convert bigger and bigger batches of commits. If we're
trying to pretend fetching from git and converting commits is actually a pull,
then that seems harder to pull off (we'd need to somehow rewind the remote head
we're pulling before importing it).
So, this adds a new external-sync command to hggit that basically the bare
minimum that we do need. It lets you specify a git remote and a head you care
about, and import up to N commits from it. That's it — no bookmarks are updated
or anything (but the git-mapfile is, of course). The only thing that changes is
your commits.
If you actually want to interact with your git repository on an ongoing basis
as if it were a remote hg repository, this is completely useless, but that
isn't what we actually do, so that should be OK.
As part of this, I've modified a few other parts of git_handler to remove
places where we called a `uri` `remote_name` (which is a bit confusing), and a
place where we were asking for a `remote_name` parameter that I don't have
here, but which we also didn't actually need (in `import_git_objects`).
Reviewed By: farnz
Differential Revision: D20836601
fbshipit-source-id: 96230e6e8269d0472404414948fd2f02aa98d79c
Summary:
Evolution crashes if you try to create obsmarkers in a repo where obsmarkers
are not enabled. Instead, check before reviving commits with obsmarkers that
it is enabled.
Reviewed By: krallin
Differential Revision: D20868173
fbshipit-source-id: b3a08ef05ddc13e9b78df8ac7c1ca1ef808b7602
Summary:
Let's mandate a 256 color terminal in Windows. We also update less to default
to using VT mode: https://github.com/gwsw/less/pull/29
With this, the colors appears to be working as expected on Windows!
Reviewed By: quark-zju
Differential Revision: D20826922
fbshipit-source-id: 5d2a149e2698b3ccc7bf6388b5cd97da20898eb7
Summary:
I'm not exactly sure why, but my guess is that by writing the py files first,
the pyc might be copied and not generated, causing Python to not read the pyc
at import time, leading to slow startup time.
Reviewed By: quark-zju
Differential Revision: D20829130
fbshipit-source-id: e838ff18b9fbf65d1a9437e0a8ef58d57803d2fa
Summary:
For whatever reason, ncurses doesn't interpret the arrow keys properly... Use
whatever is returned from it instead.
Reviewed By: kulshrax
Differential Revision: D20821432
fbshipit-source-id: 019426a1333538a479fb3dd8d147fb9cb4ba6559
Summary:
Move the attribute so it won't cause an AttributeError when remotenames is not
enabled.
As we're here, also move it to repo._remotenames from repo. This makes the repo
object a bit clearner and avoids loading the accessed bookmarks if remotenames
are not accessed at all.
Reviewed By: singhsrb
Differential Revision: D20821070
fbshipit-source-id: b5a01016451ee202f778cadb2dd418400406fa6b
Summary:
This diff turns off the support_old_nightly feature of async-trait (https://github.com/dtolnay/async-trait/blob/0.1.24/Cargo.toml#L28-L32) everywhere in fbcode. I am getting ready to remove the feature upstream. It was an alternative implementation of async-trait that produces worse error messages but supports some older toolchains dating back to before stabilization of async/await that the default implementation does not support.
This diff includes updating async-trait from 0.1.24 to 0.1.29 to pull in fixes for some patterns that used to work in the support_old_nightly implementation but not the default implementation.
Differential Revision: D20805832
fbshipit-source-id: cd34ce55b419b5408f4f7efb4377c777209e4a6d
Summary:
This isn't actually a Mercurial extension, so we can't be importing Mercurial
imports here. I'm not sure this is actually being used because we apparently
have 2 copies of this (see D20793452, which is also how I came upon this), but
it's probably worth not breaking it.
Reviewed By: farnz
Differential Revision: D20794695
fbshipit-source-id: daaf0f5822567b55a787669073421fd1ce604e08