Commit Graph

13490 Commits

Author SHA1 Message Date
Mark Thomas
088e0a8ed6 pushrebase: only prevent phase updates if replacements received
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
2018-11-07 04:32:46 -08:00
Mark Thomas
9b4c89abe5 pushrebase: add test demonstrating pushrebase phase change failure
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
2018-11-07 04:32:46 -08:00
Saurabh Singh
b496efcc9a test-hgsubversion-globalrevs: test revset interoperability
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
2018-11-06 16:42:11 -08:00
Saurabh Singh
ff98fdcc08 test-hgsubversion-globalrevs: remove the capturing ui
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
2018-11-06 16:42:11 -08:00
Saurabh Singh
32b539a13a test-hgsubversion-globalrevs: add useful params to the assert log method
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
2018-11-06 16:42:11 -08:00
Saurabh Singh
e9ebb554f3 test-hgsubversion-globalrevs: include svnrev in tests instead of rev
Summary: The `svnrev` is more useful than the `rev` in this context.

Reviewed By: quark-zju

Differential Revision: D12888963

fbshipit-source-id: a902c57ecc3bc3eca9da77ab6e14ef58512d5ad8
2018-11-06 16:42:11 -08:00
Saurabh Singh
6f25c6e5c9 hgsubversion: support resolving revset string with prefix 'r' during tests
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
2018-11-06 16:42:11 -08:00
Saurabh Singh
0d204fba6f globalrevs: introduce configuration for specifying valid starting revision
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
2018-11-06 16:42:10 -08:00
Durham Goode
718d19fce6 datapack: fix not including rename information in datapack blobs
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
2018-11-06 14:06:55 -08:00
Mark Thomas
529aa8872e absorb: use ngettext for message plurals
Summary: Pluralize messages using ngettext.

Reviewed By: quark-zju

Differential Revision: D12921683

fbshipit-source-id: a8dce90b3b9318597f888a8aca72351012de05ae
2018-11-06 03:19:01 -08:00
Aida Getoeva
dc09d0c75c move contentstore pending from localrepo to shallow
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
2018-11-05 07:53:24 -08:00
Mark Thomas
d15af3f239 cmdutil: remove amend message template
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
2018-11-05 06:28:03 -08:00
Jun Wu
f556edd8a4 fsmonitor: add migration to toggle tracking ignored files
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
2018-11-03 11:12:56 -07:00
Jun Wu
9719d371db treestate: add a debug command to list treestate content
Summary: This is to replace `debugstate -v`. The latter does ont list untracked files.

Reviewed By: DurhamG

Differential Revision: D12906649

fbshipit-source-id: b84f41dfadff4932c0ddd48480a4aa03db88cab0
2018-11-03 11:12:56 -07:00
Phil Cohen
cbf94e4a87 hgsubversion: add SVN error code to "Outgoing changesets parent is not at subversion HEAD"
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
2018-10-31 14:02:30 -07:00
Saurabh Singh
a761dbd527 test-fb-hgext-tweakdefaults-grep: fix the test
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
2018-10-31 12:09:24 -07:00
Wez Furlong
e24e242728 hg: make hg portion of biggrep grep output have deterministic ordering
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
2018-10-31 11:59:25 -07:00
Mateusz Kwapich
c697c8b81a commands: avoid implicit bool cast in "update" parameter validation
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
2018-10-31 10:27:53 -07:00
Mateusz Kwapich
292728707f tests: set disallowemptyupdate in "hg prev" test
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
2018-10-31 10:27:53 -07:00
Wez Furlong
67f16a7484 hg: fixup biggrep implementation
Summary:
a couple of problems:

* The recent move from tweakdefaults also broke `bin` symbol, rendering
  this feature completely broken for non svn backed repos
* The `bgr` tool knows about fewer corpuses than we do, so go directly
  to the underlying C++ client binary
* Add configuration options for that binary

Reviewed By: phillco, farnz

Differential Revision: D12849852

fbshipit-source-id: 154d4822d097602505349d3f67b45f19c17a7bf8
2018-10-30 19:13:56 -07:00
Aida Getoeva
8940a7c464 uncommit: move to core
Summary: Moving extension `uncommit` to the core.

Reviewed By: quark-zju

Differential Revision: D10447651

fbshipit-source-id: 2ccf7db858b78e0811ffef742c82237259492719
2018-10-30 08:00:05 -07:00
Mark Thomas
92674884fd progress: clear progress bar when locking to suspend
Summary:
The recent changes to the progress engine to work around locking bugs removed
the `clear` step of `progress.suspend`.  This leads to garbled output when
a progress bar is ongoing.  Restore it by adding a new lock method to the
engine.

Also add a `--with-output` option to `hg debugprogress` to test this.

Reviewed By: mitrandir77

Differential Revision: D12838415

fbshipit-source-id: 83ed516b528d0b0bbe37945141d50b50da00ac8e
2018-10-30 07:41:05 -07:00
Phil Cohen
de12a9e09c merge: add ancestors as transient propeties to mergestate
Summary:
We need a way for mergedrivers to be able to read ancestor data (to properly detect a backwards merge, such as during `hg backout`).

Passing it directly is tricky since passing a new kwarg to functions without `**args` raises a `TypeError`. We'd have to update the hook framework to catch this `TypeError` and re-run the hook without the kwarg, which would be hard to do cleanly.

Rather, we can just add this as a transient property on `mergestate`, which seems like an appropriate place for it. Any callers trying to read this when it hasn't been set will get an exception. But there aren't any other users of this field since it hasn't existed before.

Reviewed By: quark-zju

Differential Revision: D12827614

fbshipit-source-id: 48dc84f1e60232625c8f2a73e81b5bc223c22bb3
2018-10-29 21:04:02 -07:00
Jun Wu
13c490cf4e fsmonitor: use short list when logging notefiles
Summary:
The "fsmonitor returned" file list was made short by D9997658. Do the same
thing for notefiles.

Reviewed By: phillco

Differential Revision: D10865333

fbshipit-source-id: ff31cde04210363e6af04e5578543f1b16310b11
2018-10-29 20:26:34 -07:00
Jun Wu
df9235cb28 dirstate: remove NEED_CHECK state automatically
Summary:
If a "normal" file is clean, drop the "NEED_CHECK" bit.

Not very sure how NEED_CHECK can be set for the entire working copy while
`_poststatusfixup` does get executed. But it happened. Fix it by explicitly
removing NEED_CHECK from clean files.

Reviewed By: markbt

Differential Revision: D10865256

fbshipit-source-id: aafd3195a8acf39178bbc2d5f919345a7320f2b7
2018-10-29 20:06:09 -07:00
Jun Wu
5634fd774d tests: add a test showing NEED_CHECK bit was not removed after accidentally being set
Summary:
If the NEED_CHECK bit was set accidentally (reason yet to know), there is no
way to recover automatically by running "hg status" without touching the files.
Add a test to show that.

Reviewed By: markbt

Differential Revision: D10865255

fbshipit-source-id: 60b6914a9cd778e60815f83ba98c29c9c5f88b34
2018-10-29 20:06:09 -07:00
Saurabh Singh
66b2153f13 test-fb-hgext-remotefilelog-repack-corrupt: fix the test
Summary:
This test still fails on OSX because the messages with prefix
`remote:` are missing. It doesn't seem like we need those messages for the
actual testing. Therefore, adding the `-q` option to the affected commands to
remove the `remote:` messages for all the platforms.

Reviewed By: quark-zju

Differential Revision: D12829679

fbshipit-source-id: e53dca96b5511049ef240ed671705987cdd9eab1
2018-10-29 15:47:14 -07:00
Mark Thomas
861e5ca8d5 commitcloud: pull unknown public bookmark hashes as well as draft heads
Summary:
When syncing a commit cloud repo, if the user has put a bookmark on a public
commit that we don't have locally, also pull that public commit into the repo
so that we can put the bookmark on it.

Reviewed By: quark-zju

Differential Revision: D12815471

fbshipit-source-id: 080038e4e239170cad994ff4ab9326d787d1c0fa
2018-10-29 04:19:07 -07:00
Mark Thomas
228cf6b027 commitcloud: add a test demonstrating public bookmark sync problem
Summary:
If you put a bookmarks on a public commit that one of your other synced
repos doesn't have, it will delete the bookmark when it syncs.  This deletion
is then propagated to all your other synced repos.  This appears to the user
like the bookmark just vanishing.

Reviewed By: quark-zju

Differential Revision: D12815470

fbshipit-source-id: 802f85433b9ad15db3fb9e82e1222224eff4ca88
2018-10-29 04:19:07 -07:00
Jun Wu
d8bde83566 tests: fix test-extensions-default.t for buck
Summary: On buck build, extension discovery does not work.

Reviewed By: markbt

Differential Revision: D10862029

fbshipit-source-id: b9d5c4edde4d2f8518df47c22099fde29e2a09cc
2018-10-27 15:14:14 -07:00
Mark Thomas
7009f7f2b0 cmdutil: add message template for amend -m
Summary:
Introduce a new template config option `amend.messagetemplate`, which, when
set, is applied to the commit message when amend is run with the `-m` option.

The template is provided with the old message, as `oldmessage` as well as the
message provided on the amend command line, as `message`. This can be
configured so that the amend message only overrides part of the old message.

Reviewed By: quark-zju

Differential Revision: D10857454

fbshipit-source-id: 6eb6f33624fae32fc7a344769e39f5c7a78a3604
2018-10-27 11:32:05 -07:00
Mark Thomas
1ac1128def truncate: add truncate implementation
Summary:
The `truncate` tool isn't availble on OSX, so include our own in the test
suite.

Reviewed By: DurhamG

Differential Revision: D12815613

fbshipit-source-id: 510b2936f07c5193671baaeaec6620872c3ec982
2018-10-27 10:59:21 -07:00
Mark Thomas
958b361db9 blame: make blame show how old a line is
Summary:
Add label annotations to the blame template indicating how old the line is
(bucketed into various ranges).  Define colors for these labels so that recent
lines are white, and older lines fade through yellow to black.

Reviewed By: phillco

Differential Revision: D10869068

fbshipit-source-id: 2b99c84c115c3f9e408468f52b5754ff820fcec5
2018-10-27 10:32:32 -07:00
Mark Thomas
c53f941c82 tweakdefaults: make blame phabdiff numbers longer
Summary:
Make the space for Phabricator diff numbers larger, and right-justify the
output.  This makes it look better.

Reviewed By: phillco

Differential Revision: D10868646

fbshipit-source-id: 7cf50677560a15ef77cc3681063e902d8d9e7a18
2018-10-27 10:32:32 -07:00
Jun Wu
8c4a52d608 config: enable obsstore by default
Summary:
This makes tests closer to production setup and removes a bunch of "saved
backup bundle to ..." messages.

With D9236657, this should not hurt server-side performance.

Unfortunately a lot tests cannot be migrated easily, mostly because revision
numbers are used. They are left with a TODO.

Reviewed By: DurhamG

Differential Revision: D9237694

fbshipit-source-id: c993fce18f07aba09f6d70964e248af8d501575a
2018-10-26 18:54:40 -07:00
Jun Wu
061ca2cef4 unittestify: treat skip as success by default
Summary:
The test infra does not handle "skip" state gracefully and treats skips as
"failure". That generated scary reports like hundreds of tests are failing.
Stop reporting skips to fix it.

An enivronment variable is added to get the old behavior.

Reviewed By: singhsrb

Differential Revision: D12808196

fbshipit-source-id: 2356a1d6fdfe1d2991d28368787c7d2b7b525b6b
2018-10-26 15:47:07 -07:00
Jun Wu
644ec66f6f rebase: add a test showing that copy obsmarkers work
Summary:
With the obsmarker copying feature, rebasing revs containing obsolete
relationship would result in the markers being copied correctly.

Reviewed By: phillco

Differential Revision: D7121486

fbshipit-source-id: a666ad65c2eccbfd26db813d4f792c66489ead8c
2018-10-26 13:00:59 -07:00
Mark Thomas
5e785a473f remotefilelog: handle corrupt pack files during repack
Summary:
If a corrupt pack file is encountered while marking the ledger for repack,
handle the failure.

Don't immediately delete the pack files.  Keep them around as we may be able
to repack some of the non-corrupt contents (particularly when the file has
been truncated).

Once repack has completed, revisit the corrupt packs that we found.  For shared
packs, delete them.  For local packs, rename them.  They are the only source of
the data, and we may be able to recover more data manually.

Reviewed By: DurhamG

Differential Revision: D10527544

fbshipit-source-id: f228fb4de3ff016a1c9035823bfa1d6b7767cdcb
2018-10-26 01:16:13 -07:00
Mark Thomas
b10c8ada95 remotefilelog: add incremental repack for local data
Summary:
The incremental repack implementation omits repacking local data - it was
recently added for full repack, but not incremental repack.  Add it to
incremental repack.

We also don't run `_deletebigpacks` for non-shared data, as that data is
only stored locally.

Reviewed By: DurhamG

Differential Revision: D10525957

fbshipit-source-id: 012d7e8d455ac607773fc7013dcc4df0881665e8
2018-10-26 01:16:13 -07:00
Mark Thomas
02a0c8503d remotefilelog: store loose file filenames alongside the data
Summary:
Loose files don't contain the original filename inside them, but rather the
directory name is based on the sha1 hash of the filename.  This means that
given a remotefilelog data file, we can't find out the name of the file that
it contains.

Repack needs to know this (plus it's also useful for debug purposes), so add
an additional file in the directory, `filename`, which contains the original
filename of all the data files in the directory.

It follows that `sha1(read(filename)) == basename(dirname(filename))`

Reviewed By: DurhamG

Differential Revision: D10516851

fbshipit-source-id: aeeb1a116e0d50a134c274c3bb31c7c26aa8015c
2018-10-26 01:16:13 -07:00
Phil Cohen
3e9988215e tests: fix test-commandserver
Summary: D10435279 somehow landed with a green test run, but I suspect it broke this.

Reviewed By: DurhamG, quark-zju

Differential Revision: D10863085

fbshipit-source-id: 3f4e95c7838c39f5801430356b72901d70086173
2018-10-25 18:06:09 -07:00
Phil Cohen
f2a3798dfa commands: rename hg grep to hg histgrep
Summary:
tweakdefaults renamed core hg's `grep` to `histgrep`, and added a `hg grep` that behaves more like `git grep`, searching the working copy. This diff folds those changes into core.

The config changes from

```
[tweakdefaults]
allowfullrepohistgrep = False
```

to

```
[histgrep]
allowfullrepogrep = False
```

Reviewed By: quark-zju

Differential Revision: D10435279

fbshipit-source-id: ad3d1da5824511a612111715e46119d70066050f
2018-10-25 14:54:22 -07:00
Phil Cohen
d0dbcab195 filemerge: print the potentially conflicting destination commits for each conflict
Summary:
One thing that makes dealing with merge conflicts difficult at Facebook is that it can be tough to know *why* you have merge conflicts.

Because rebase processes one commit at a time, it's clear which of *your* commits is the problem, but finding the "other" commit is surprisingly hard. Often we rebase onto `master`, and in a monorepo, `master` is often a random commit that has no relationship to your code at all.

This diff attempts to improve the situation a bit by listing all of the commits between the common ancestor and the destination commit that modified the file. The user can then identify which are likely culprits:

```
  warning: 2 conflicts while merging b! (edit, then use 'hg resolve --mark')
   3 commits might've introduced this conflict:
    - [0942ca9aff3d] random commit 1
    - [3ebd0a462491] foo bar biz
    - [3e5843b4b236] blah blah blah
```

When the destination is public, this approach requires one loose file download (~0.5s?) per conflicted file (this pulls in the full filectx history DAG, so further downloads aren't needed), which is likely acceptable as it only runs on conflicts, and provides value to the user. But it's also configurable for users performing massive codemods.

I'll add metrics to gather the average number if matched commits and the time taken to generate.

This doesn't put this information into the conflict markers, so a lot of people (Nuclide users or the default `editmerge` users) won't see it. We need to think creatively about how to expose it to them.

The ideal solution would tell you which commits edited the actual conflicted section(s), not just those that touched the file.

This requires fast remotefilelog downloads (cc @[100000771202578:Arun] :)). Once we have those, we can construct a local `linelog` of the commits involved, and used this to identify precisely which commits edited the conflicted sections of the file.

Reviewed By: quark-zju

Differential Revision: D9816270

fbshipit-source-id: 04e08dea7a9429eaeab0d40310cd34355104bb74
2018-10-25 14:02:51 -07:00
Mark Thomas
5a6793ba4e infinitepush: add debugging for when bg pushbackup takes the lock
Summary:
Normally pushbackup should not take the repo lock.  To debug when this does
occur in the background, add a debugstacktrace for lock aquisition when
infinitepushbackup.bgdebuglocks is set.

Reviewed By: quark-zju

Differential Revision: D10508808

fbshipit-source-id: 3cb2c155bac88751122111d91bdc1f51b381f7ff
2018-10-25 13:27:00 -07:00
Jun Wu
f1f4dc4c2c threading: add a way to workaround Python bug 29988
Summary:
The [bug 29988](https://bugs.python.org/issue29988) is, when Ctrl+C (or other
signal) interrupts a program between certain Python bytecode instructions,
`__exit__` might be skipped incorrectly.

A single signal can only skip a single `__exit__`. Therefore it can be
worked around by using a list of `with`s, like:

  with c, c, c, c, c:
      ....

Make `c.__enter__` and `__exit__` do the real `__enter__` and `__exit__` at
most once. To use the bug to skip all 5 `__exit__`s, 5 signals need to be
delivered at 5 tiny windows, which is unlikely to happen practically.  Besides,
we can increase the count of `c`s to become more confident.

Note this has to be implemented natively since pure Python code cannot
have a reliable way to record whether `__exit__` was called or not:

  self._obj.__exit__(...)
  # Insert SIGINT here
  self._exit_called = True

The inner object has to be native too to make `__exit__` atomic. Currently,
it's restricted to only the `Condition` object.

Reviewed By: markbt

Differential Revision: D10850510

fbshipit-source-id: 5c523a7bce568509641f8870d7ea381c0a99975c
2018-10-25 13:12:00 -07:00
Jun Wu
a906cd90a0 run-tests: use Rust RLock implemenation if possible
Summary:
The Rust implemenation has a smaller chance to have deadlock issues when
interruptted.

Reviewed By: markbt

Differential Revision: D10843400

fbshipit-source-id: af5614b9992577bde74cf54c5760d15d050aafbf
2018-10-25 13:12:00 -07:00
Jun Wu
fe6f7ecf7b rust: reinvent Python's threading.Condition
Summary:
Python 2's `threading.Condition` and `threading.RLock` implementation are in
pure Python. Part of `RLock.acquire` looks like (simplified):

    def acquire(self, blocking=1):
        me = _get_ident()
        if self.__owner == me:
            self.__count = self.__count + 1
            return 1
        rc = self.__block.acquire(blocking)
        ########## Here #########
        if rc:
            self.__owner = me
            self.__count = 1
        return rc

If an interruption (ex. SIGTERM) happens at "HERE". The lock would be in an
inconsistent state. And if some `finally` block, or `__exit__` in a context
manager tries to release the lock, it could deadlock.

Similar problems also apply to `release`, `_acquire_restore`, and
`_release_save`. Basically, `self.__owner`, `self.__count` and `self.__block`
(i.e. the real lock) cannot be guaranteed in a consistent state in pure Python
world, because interruption can happen before any Python bytecode instruction
(but not inside a single Python bytecode instruction).

Therefore the interruption-safe implementation cannot be done in pure Python.
Use Rust to rescue.

The added test `streetest-condint.py` has a high chance to reproduce the
deadlock issue with Python 2.

Python 3 has a native RLock implementation, which makes things better. The
"Condition" implementation is not native and I haven't checked whether it
is sound or not.

Unfortunately, as part of testing, I hit https://bugs.python.org/issue29988 and
confirmed from the Rust world. That is, `__exit__` is not guarnateed called (!!)

That means native implementations still have a chance to be wrong, and there is
no easy way to fix it. `streetest-condint.py` was then updated to expose the
issue more easily.

The implementation is better than Python 2 stdlib, though.

Reviewed By: markbt

Differential Revision: D10517920

fbshipit-source-id: 394c9050c512ce2a0f9743c28ccfafe0f560141a
2018-10-25 13:12:00 -07:00
Wez Furlong
5e817f6cc7 make biggrep the default for hg grep in eden
Summary:
Adds the `grep.biggrepcorpus` option that links the repo to the appropriate
biggrep corpus to each of the repo specific configs that we maintain.

This allows us to know when a repo can be used with biggrep.

Use this option to automatically enable the use of biggrep when in an eden repo.

Reviewed By: quark-zju

Differential Revision: D10434568

fbshipit-source-id: a2c77d8c58b611f818d08725a6298dec1263bb8a
2018-10-24 20:36:25 -07:00
Phil Cohen
62181f3796 reset: remove "resetting without an active bookmark" message
Summary: I don't see the point of this message, since resetting an unmarked head is perfectly fine. Nuke.

Reviewed By: markbt

Differential Revision: D10510231

fbshipit-source-id: ad0c389ddd5bc40f9d6648c7c52968c4abd91d38
2018-10-24 13:21:04 -07:00
Durham Goode
574d6e98a1 hggit: change git-mapfile to be append only
Summary:
This changes the git-mapfile to be append only. It then makes gitlookup
find hashes by scanning from the end of the mapfile backwards. Since most
lookups are for recent commits, this should greatly speed up hg->git hash
lookups and remove the need to sort the mapfile before writing.

Reviewed By: singhsrb

Differential Revision: D10521208

fbshipit-source-id: 7073d3f4796674416ae05e0ac9f36035ca0835db
2018-10-24 08:39:19 -07:00