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:
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:
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:
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:
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: 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:
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:
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:
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:
We've seen a number of recent cases where hg stops using watchman for
status because state-enter or state-leave fail because multiple enters or leaves
are called out of order. The root cause needs to be found, but in the mean time
we should not allow such errors to block of from using watchman entirely.
Let's eat these gracefully and just log that the issue happened.
Reviewed By: quark-zju
Differential Revision: D20807004
fbshipit-source-id: 517d9562febc226ce7db836435ca2ca9db1c68fb
Summary:
On shared devservers, all users in svnusers should be able to read/write onto
the stores, set the umask to properly reflect this.
Reviewed By: ikostia
Differential Revision: D20817266
fbshipit-source-id: 8a865f499a35313afd3cbeb5f989175862a3549f
Summary:
This updates fastheaddiscovery to use an unfiltered repository when it attempts
to check if the nodes the server sent are present locally.
Reviewed By: quark-zju
Differential Revision: D20792006
fbshipit-source-id: 14ba9605d79ba54f3f4143d6d8ec65357e3d8c07
Summary:
The new API does nothing that cloud sync does not want: bookmarks, obsmarkers,
prefetch, etc. Wrappers to disable features are removed.
This solves a "lagged master" issue where selectivepull adds `-B master` to
pull extra commits but cloud sync cannot hide them without narrow-heads. Now
cloud sync just does not pull the extra commits.
Reviewed By: sfilipco
Differential Revision: D20808884
fbshipit-source-id: 0e60d96f6bbb9d4ce02c04e8851fc6bda442c764