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
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
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
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
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
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
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
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
Summary:
The Rust implemenation has a smaller chance to have deadlock issues when
interruptted.
Reviewed By: markbt
Differential Revision: D10843400
fbshipit-source-id: af5614b9992577bde74cf54c5760d15d050aafbf
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
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
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
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
Summary: I think D10446929 might've broken this by changing the pull string such that there was no German translation for it.
Reviewed By: quark-zju
Differential Revision: D10520682
fbshipit-source-id: a39b5911295ee0d1f5eee3b307930cffa87c3562
Summary: Updated help text for hg pull and hg rebase
Reviewed By: markbt
Differential Revision: D10446929
fbshipit-source-id: a81e186398cda02f58df95e6f2613b3f7457d9ed
Summary: Its functionality was folded into core a while ago, so we can just call `log -G`.
Reviewed By: quark-zju, singhsrb
Differential Revision: D10509538
fbshipit-source-id: 5c16ff708072e9bebabaf3b8e1474091dfb35216
Summary:
When you get an error, let's print the number of conflicts in each file. This will give the user some sense of how much work they have to do.
The code change is entirely in `filemerge.py`, and `tests/test-merge-conflict-count.t` adds a new test.
Reviewed By: quark-zju
Differential Revision: D9815243
fbshipit-source-id: 1b73a1db293902ac7242997a7d6ae09478344068
Summary:
Remove extensions that are not used in prodution. These extensions are also
unlikely to be used in the future.
Reviewed By: ikostia
Differential Revision: D10473370
fbshipit-source-id: a936e30acd3ec4370434c583447942c6ee8d9b13
Summary:
Since we can now skip a large ignored directory efficiently, just track the
ignored files in treestate. This fixes the "unignore" correctness issue that
has been there for years.
It also makes it easier to implement a faster version of "status -i" or "purge
--all". But that needs some extra changes.
It looks fine for fbsource sparse profiles. But we don't control all the
possible sparse configs out there. It's possible for certain users to have
sparse configs that cannot be optimized efficiently and their hg performance
will degrade. To reduce risk, a config option is added so we can slowroll the
feature and collect feedback.
Reviewed By: DurhamG
Differential Revision: D10352851
fbshipit-source-id: fbcb8445d87a50826852b832bbb0559ab199192f
Summary:
Previously, git-getmeta would have to scan through the entire git map
file, which was extremely expensive. Let's shift this cost to write time by
sorting the map file before writing, then using bisect to lookup nodes.
A while ago we switch hggit to only serialize the mapfile every 100 commits or
so, so the additional time here shouldn't be excessive.
Reviewed By: quark-zju
Differential Revision: D10470293
fbshipit-source-id: 47e23d251adde5456e7b593bfcc5976259a497f2
Summary:
Replace `sparse delete` (which deletes an include or exclude rule) with commands
that better describe what they do.
Also update `include` and `exclude` to additionally remove the rule from the
opposite set. It makes no sense for a file to be both included and excluded.
Reviewed By: phillco
Differential Revision: D10446704
fbshipit-source-id: 8966f7d0e54b1aae737fa0bae9cf35ed7ce88696
Summary:
Add a new sparse show command, which shows the current sparse configuration.
Use common templating, including colors, between sparse show and sparse list.
Reviewed By: phillco
Differential Revision: D10446705
fbshipit-source-id: acb539f80f625945716758c785703b46a81aa6f1
Summary:
Allow commands that have subcommands to categorize the subcommands. These
categories appear in the help for the top-level command.
Reviewed By: phillco
Differential Revision: D10446708
fbshipit-source-id: a7f2a9bc79c2a2c4df90517a5e6c9a4b78b31a72
Summary:
All ssh stderr are prefixed by "remote:", which could be confusing because the
message can also be some errors from the local ssh program. Treat "ssh:" as a
special case and do not prefix it with "remote:".
Reviewed By: markbt
Differential Revision: D10437082
fbshipit-source-id: 37935bd7276969ef17fa5028b02d01e3c9d0bf30
Summary:
On OSX the path to the hgrc can be so long it word wraps. Let's update
the test to accomodate the extra line.
Reviewed By: quark-zju
Differential Revision: D10453508
fbshipit-source-id: 5ba9db86f8475ab31ddb4b0e32da4feeeb8b5ce8
Summary: Signifying the change of perftweaks from an extension to a config grouping.
Reviewed By: quark-zju
Differential Revision: D10416857
fbshipit-source-id: b233a353c7da1d211ad0a7e53b942244863a83b3
Summary: Config-gate it so we don't have it popping up in tests everywhere.
Reviewed By: quark-zju
Differential Revision: D10432784
fbshipit-source-id: 531007432d67fef6ff504e319e43fb596d6a0d27
Summary:
Per D8985248, this code isn't necessary anymore under clindex. clindex is out everywhere now, so let's nuke it.
Shortens this file by 30%!
Reviewed By: quark-zju
Differential Revision: D10414815
fbshipit-source-id: 795c625afd128d94f09d0f7c1b294a7f7d8eea14
Summary: tweakdefaults was overriding two configs to reconcile core/fb behavior. Let's just fold it in to the default.
Reviewed By: quark-zju
Differential Revision: D10432786
fbshipit-source-id: 2f56baa2d11d7814bffc489e56cb155548d1fc97
Summary:
Manifestlog needs to use `00manifesttree.i` for filecache if treeonly is turned
on.
Teach `filecache` to also cache non-existed files and add `00manifesttree.i`
to `repo.manifestlog` check list.
Assuming inode cannot be 0, `cacheable` is a constant `True`. Drop code
dealing with `cacheable = False` accordingly.
Reviewed By: DurhamG
Differential Revision: D10417795
fbshipit-source-id: c8aedd36dc39592c86847bf4327ed9c46736bab0
Summary:
Aliases can be additionally configured with documentation by adding an entry of
the form:
```
[alias]
aliasname:doc = help text
```
The help text for the alias will be displayed if the user runs `hg help
aliasname`, and in the list of commands when the user runs `hg help commands`.
Reviewed By: phillco
Differential Revision: D10428399
fbshipit-source-id: 14338902fce6efab4c8d3b2541cdcf5b15385784
Summary:
Reorganise the top-level help commands to more useful categories, allowing them
to be listed in a custom order.
Reviewed By: phillco
Differential Revision: D10423184
fbshipit-source-id: 17f02ae201493397a448d108e781eca28a7b1d44
Summary: After D10407265 this is no longer needed.
Reviewed By: quark-zju
Differential Revision: D10407826
fbshipit-source-id: 5291981637d940a6d19cda1b814b81b745d9ca92
Summary:
This message as a warning is not actionable. wez, philco, markbt and
mitrandir77 seem to agree that this is a good approach.
Note that this message is still printed in debug mode.
Reviewed By: farnz
Differential Revision: D10336756
fbshipit-source-id: ea55d298569787d2e19eb1ffcfe6ff75935fb650
Summary: As a signal that sparse is cleaned up.
Reviewed By: phillco
Differential Revision: D10335537
fbshipit-source-id: 773a12a00cfe040f08871bf14423faa5eae9bdad
Summary: No point in tweaking it externally if we can just add relevant stuff.
Reviewed By: phillco
Differential Revision: D10335080
fbshipit-source-id: 47c009bf820f8f41f586b714181e82bea88dfa49
Summary:
Note that this is more aggressive than the tweakdefaults version; it doesn't allow named branches to be created or listed at all with the config set. As we want to delete named branches entirely, this seems reasonable.
I ported the `--new` flag, but made it optional, to make it easier to support both the core and tweakdefaults callers.
Saurabh Singh and I chatted with the releng team (Craig).
**tldr:** we can remove named branches from the UI but should keep the innards for now
Today the releng team doesn't make any branches (#continuous), but in the near-term future, they might either:
- create remote bookmarks in hg (similar to fbsource)
- create branches in SVN (which are then synced as hg branches by hgsubversion)
- We'll leave all the hgsubversion code to do this alone, just remove user-facing entry points
- They'll also need to be able to query for a commit's branch (`hg log -T '{branch}'` will still work)
- Once www is on hg, this possibility goes away and we can kill named branches for good
Reviewed By: ikostia
Differential Revision: D10401485
fbshipit-source-id: 6f2f3ae28af249bae1fdf782eb14fe7bfc472bb7
Summary:
Alas, it has to be config-gated for now, because a number of core tests depended on the empty-destination update behavior (which is sophisticated).
I'll send a followup diff to remove them.
Reviewed By: kulshrax
Differential Revision: D10376546
fbshipit-source-id: 2ac79e03a91551f96cf8e743c0ee9719557c4fbe
Summary:
The new hg absorb UX still prompts if there is nothing to be absorbed.
Instead, detect this condition and just exit with a message.
Reviewed By: ikostia
Differential Revision: D10382216
fbshipit-source-id: 5cd1aa9de457cc3475bcda064e8761b3ddf1ad40
Summary:
This greatly simplifies the implementation, too.
*updatetotally() change:*
`hg up` now passes a brev of `None` if the `--inactive` flag was passed. This avoids activating the bookmark if one was passed. However, it still needs to deactivate the active bookmark, if there was one. After looking at the existing code, I think it was just wrong.
The rest of this is just cleanup.
Reviewed By: markbt
Differential Revision: D10376544
fbshipit-source-id: e5ad8aa01acab906db4d3fc09c6450e3c48b59fb
Summary: Make a few help messages clearer.
Reviewed By: phillco
Differential Revision: D10356915
fbshipit-source-id: 277d4cecbd17b647d6dd01209ff6f93a926d37d4
Summary:
Replace the default help for Mercurial with a curated list of interesting
commands, categorized by their use case.
Reviewed By: phillco
Differential Revision: D10356916
fbshipit-source-id: 65e578a4bfde7b0ad04e7107f4e77d8ea882d78a
Summary: NB: `hg tags` still prints out all tags, just with a warning first. Maybe we could disable that entirely too while we're here.
Reviewed By: ikostia
Differential Revision: D10314175
fbshipit-source-id: 603a4dc46e05337189934803a18eef1188a02272
Summary:
It turns out core already implemented this, so let's just use their version.
Switch the facebook.rc config to it.
Reviewed By: ikostia
Differential Revision: D10306234
fbshipit-source-id: b0ee5e865ec4e0d8412dbd310a7e5017399b48c9
Summary:
Let's start moving tweakdefaults things into core.
Since we set the config in our rc files, I've renamed it.
Reviewed By: ikostia
Differential Revision: D10306236
fbshipit-source-id: 9a6b3bf7e22d8faf7b53446021660bb0923cf666
Summary: This tests works with `run-tests.py` but fails with buck.
Reviewed By: mitrandir77
Differential Revision: D10378486
fbshipit-source-id: 7112560a2d6b05b0a39f3df423ccac52bdc5202c
Summary:
Update hg absorb to use the templater and display the first line of the
description of the affected commits.
Also change the default behaviour to display the changes and prompt the user to
confirm that absorb is going to do what they want. Use the new `-a` option to
get the old behaviour.
Reviewed By: quark-zju
Differential Revision: D10366510
fbshipit-source-id: 23df2e5ab2d21a0805a16e7118686a29634d2918
Summary:
There are some code paths (ex. "purge --all") that sets watchman clock to None
unexpectedly. That makes the next command slow. Bypass it by detecting the case
and avoid setting clock to None.
Reviewed By: DurhamG
Differential Revision: D10188143
fbshipit-source-id: 4c35dfcee658ca2075d686da7d886e4b3a352b5a
Summary:
With treestate, watchman clock is not expected to be reset. But `purge --all`
bypasses some fsmonitor code paths and manages to reset the clock. Add a test
to show that.
Reviewed By: DurhamG
Differential Revision: D10188142
fbshipit-source-id: 4524979fb96d41fab881b7ee44ad9fa854081b26
Summary:
This extension exposes only the `record` command which can be easily
moved to core. This commit achieves the same.
Reviewed By: ikostia
Differential Revision: D10360759
fbshipit-source-id: 25f0c46aa3fa9b19ab8ba03a6b4e8598bc003c7a
Summary:
dirstate.untrack is used in two cases. Let's move the case where the
file is known to be actually deleted from disk to its own function. This allows
the treestate implementation to actually remove the entry from the structure,
which solves some case sensitivity issues.
Reviewed By: quark-zju
Differential Revision: D10317737
fbshipit-source-id: 09bc35d01cf5e52fdcbf45ea39c5d2f85fa39949
Summary:
There's a treestate bug on case insensitive filesystems where updating
across a case rename can cause junk to show up in hg status. A future diff fixes
this, but let's add a test first.
Reviewed By: ikostia
Differential Revision: D10317739
fbshipit-source-id: c1aa274cb55dd64cdb54ceadbd3c306151bd84d6
Summary:
dirstate.drop() is used in two different situations. 1. To make a
tracked file become untracked, and 2. To remove a file from the dirstate
entirely. In the treestate case, this difference matters, so let's split drop
into two functions, one to mark something as untracked, and the other to remove
it entirely.
In this first patch we just rename drop to untrack. The next patch will
introduce the new delete function.
Reviewed By: ikostia
Differential Revision: D10317738
fbshipit-source-id: 85950ab1b1a10cd481edcfbba6da445b3dbf6397
Summary:
The extension only offers one command i.e. `show` which can move into
core.
Reviewed By: ikostia
Differential Revision: D10302192
fbshipit-source-id: 9473ec8c80e52506e1b7de62b2c90a51c29419c1
Summary:
The functionality we care about is provided by the `fbshow` extension.
Therefore, lets replace the `show` extension with the `fbshow` extension.
Reviewed By: ikostia
Differential Revision: D10302193
fbshipit-source-id: e6d137f52427d5e6f124714d06b5b55ef0db7c3c
Summary:
This commit just removes the `show` extension.
This commit was split out of D10302193 to address the review comment in that
diff.
Reviewed By: ikostia
Differential Revision: D10359525
fbshipit-source-id: b77a08a7efbaa56eb5a4ceb2dbb3fecaba35f58b
Summary: Traditional shelve did not require `obsstore` to be enabled, which means that `saved bundle` messages were printed a lot. This change fixes all tests that expect these messages.
Reviewed By: singhsrb
Differential Revision: D10261258
fbshipit-source-id: 2b4b10ee94ae9b5723cb69fc8f7c29bc65613774
Summary:
The bug:
This happens because `repo['']` resolves to a `wctx`. This might be undesirable
in its own right, but before we fix that, we can work it around here.
Reviewed By: singhsrb
Differential Revision: D10261261
fbshipit-source-id: 8cb0e96762ffba24030f9e6bae8b0d0c108e3938
Summary: This is a first step towards making `obshelve` a real `shelve`.
Reviewed By: singhsrb
Differential Revision: D10261262
fbshipit-source-id: 7dccfbd7958cdf674c33c8ead73dcd279cebade6
Summary:
The functionality we care about is provided by the `fbamend`
extension. Therefore, lets replace the `amend` extension with the `fbamend`
extension.
Reviewed By: farnz
Differential Revision: D10320739
fbshipit-source-id: 5700d39f488777fcc4033f60ce0a51cda15ef2ad
Summary:
The logic we care about has been moved to core so we can delete the
`inhibit` extension.
Reviewed By: markbt
Differential Revision: D10276448
fbshipit-source-id: 44cabe5d561344cf8f196127ce52491e4654b598
Summary:
Treestate is missing its pathcomplete fastpath. This makes tab completion for
filenames slow on large repositories.
The Rust implementation already supported the feature, it just needs to be
called from the debugpathcomplete commands.
Reviewed By: quark-zju
Differential Revision: D10259633
fbshipit-source-id: f918d55c5bcd21805615710c0eb6302f8ea4b15c
Summary:
Parts of the treedirstate implementation were left in the extension. Since
treestate is now in core, and the two are intertwined, treedirstate should be
in core, too.
In doing so:
- Change the garbage collection behaviour to match that of treestate.
- Use the treestate config options for configuring repacking and garbage
collection.
- Make more of the code common.
Reviewed By: quark-zju
Differential Revision: D10258265
fbshipit-source-id: 89e82bc7662a3d1251fa9886751897cfc46cd66a
Summary: D10244968 changed the parser output but missed this test case.
Reviewed By: quark-zju, singhsrb
Differential Revision: D10261202
fbshipit-source-id: f3b6a4429b792e413f285fb33dfd6b64934ec477
Summary:
On the server, once we enter treeonly mode we still want to be able to
strip trees from the revlog.
Reviewed By: quark-zju
Differential Revision: D10248895
fbshipit-source-id: 15faec870370d4c28f6a83058eb1bf19cb414d29
Summary:
There's a bug where strip in a treeonly server will not strip the tree
revlogs. Let's add a test so a later fix can show the impact.
Reviewed By: quark-zju
Differential Revision: D10248897
fbshipit-source-id: f45e5abc59eeb9398ba17dd927a5f8eb50bc51af
Summary:
As we transition to treeonly, let's be sure every push contains a
manifest for every commit. To do so, let's add a hook that checks this.
Reviewed By: quark-zju
Differential Revision: D10244912
fbshipit-source-id: 6c2023b1cba5663ed386888a2007a005bc02f688
Summary:
There's an issue now where if a client is treeonly but does not have
sendtrees enabled, it could push commits to the server without manifest data.
Let's add a test for this.
The next commit will introduce a hook to catch this case.
Reviewed By: quark-zju
Differential Revision: D10244913
fbshipit-source-id: 2d6c3081c7190831e0368b0dab472d14e893471f
Summary: pest was upgraded by me to version 2.x which introduced the concept of End Of Input in the parsin rules. Modify the test case to be aware of this.
Reviewed By: singhsrb
Differential Revision: D10255598
fbshipit-source-id: 31ecf56f5cf75a16c799a93aefe7df9a3837b902
Summary: Create pack files instead of loose files for local data. Now this feature is under the config flag.
Reviewed By: DurhamG
Differential Revision: D9700992
fbshipit-source-id: b1ee897ac6fd2fe208f54f999b230353aebaca5b
Summary:
The age extension provides a couple of revsets relating to commit ages. Move
these to core.
Differential Revision: D10239000
fbshipit-source-id: 6ebf3aa263b72e4bbbe25bd516f77b17145e6e7f
Summary:
Currently `hg bisect` asks to run test on all commits it picked as a result of bisection, even if the changes between last checked nodes and chosen one relate to the files, which are not in the sparse profile.
And so it updates to the one of such commits, shows that "0 files were updated" and asks to run tests.
In this diff I check next potential node (result of bisecting) if there are changes between last good commit/last bad commit and the node. And go further to the next bisection iteration if the node can be skipped (nothing was changed since last good commit in sparse profile's files, so we can assume that the node is good as well).
If there are changes on both sides: between bad and the node, good and the node, I ask to run tests.
Reviewed By: markbt
Differential Revision: D9629683
fbshipit-source-id: f8c5d82f7b44ac14a9190c846ee65d635e447af1
Summary:
Verify SHA256 before writing content to the local blob store. This avoids
issues when the remote store does not response with the correct content.
Differential Revision: D10212567
fbshipit-source-id: 5683058670487df53fb14653d83c27da11367e76
Summary:
Move the `predecessors` and `successors` revsets to core, and unify the
variants as a single revset.
Before:
* `predecessors` (provided by fbamend) only returned the immediate
predecessors.
* `successors` (provided by core) returned the given commit and all eventual
successors.
* `allpredecessors` and `allsuccessors` (provided by fbamend) returned all
eventual predecessors and successors, not including the original commit.
Now all these revsets work like the old core `successors`, and additionally
have `depth` and `startdepth` parameters which can be used to customize the
behaviour. This makes them analogous to `ancestors` and `descendants`.
To maintain compatibility with existing users of `allpredecessors` and
`allsuccessors`, these revsets default to a start depth of 1, so they
do not include the original commits.
Reviewed By: quark-zju
Differential Revision: D10028043
fbshipit-source-id: e006700ccf430b7c5d6bd9588253872bce9a18ed
Summary:
Previously the manifestrevlogstore kept a copy of the changelog, the
store, and the svfs from the initial repo object. It's possible that these will
change or be replaced over time, so it's not safe to cache them. Instead let's
just fetch them again each time we need it.
Reviewed By: quark-zju
Differential Revision: D10156425
fbshipit-source-id: ac1e310b51be0377ba9bea75aa1806d256cc5b87
Summary:
This flow has a bug, so let's introduce a test to expose the break. The
next diff will fix the bug.
Reviewed By: quark-zju, singhsrb
Differential Revision: D10156424
fbshipit-source-id: 51d1d8da6728ee930dc1440cd3e685d7c5b5df2a
Summary:
At the moment they are not recorded because setrecordingparams may not be set
before hooks are called.
Also hooks weren't recorded because pushrebasereplacements weren't correctly
set and KeyError was thrown. This diff fixes it
Reviewed By: quark-zju
Differential Revision: D10147933
fbshipit-source-id: ef33d3e4efa7f3c42e7fcc22ee5f6e54068bf1dc
Summary:
Let's log reponame as well so that we can tell requests to different repos
apart.
I named config value `common.reponame` so that we can start using it in different extensions that also need reponame (for example, hgsql and infinitepush)
Reviewed By: farnz
Differential Revision: D10127734
fbshipit-source-id: 031c7393dfce43bf47474ac0878c1e68ddabec50
Summary:
It's useful to know because we can track down slow requests and potentially fix
them on the client.
Reviewed By: farnz
Differential Revision: D10127735
fbshipit-source-id: d21088b50065f322b0c312f048f5828b3d96f99f
Summary:
Add the `sparse switchprofile` command, which lets users specify a set of
sparse profiles they would like to switch to. This is equivalent to `hg sparse
reset` followed by `hg sparse enableprofile`, but in a single step.
Reviewed By: farnz
Differential Revision: D10141938
fbshipit-source-id: 5a1e547d21e3246237fffb17f3b512da18fac804
Summary: Reformat all opted-in python code with version `18.9b0` of Black.
Reviewed By: ambv
Differential Revision: D10126605
fbshipit-source-id: 82af0d645dd411ce8ae6b8d239e151b3730cd789
Summary:
In D10023543 stackpush was added, and conflict check can happen earlier. In
that case failed pushrebase wasn't recorded. This diff fixes it.
Reviewed By: quark-zju
Differential Revision: D10119679
fbshipit-source-id: ef12e00a43375151f81a95eec2d9f02db0a9b12b
Summary: When stripping rev x, revlog revisions with linkrev >= x should be deleted.
Reviewed By: phillco
Differential Revision: D10108592
fbshipit-source-id: 2f9f5663327c4494bd7e836ab24ffc7e507530f4
Summary:
* Rename takelock to dbwritable
The word "lock" is unclear what lock (local or SQL) it is. Make it clear it's
all about database writes.
* Rename waitforlock to enforcepullfromdb
Again, unclear what lock it is. It's also unclear what it does. Rename to
"enforce pull from db" to make it obvious.
* Rename syncdb to pullfromdb
"sync" is unclear about what direction to sync. Use "pullfromdb" to make it
clear. The hook name is unchanged for compatibility.
Reviewed By: phillco
Differential Revision: D10108594
fbshipit-source-id: fff405e2df9e926f5db436ef74cb5a9aacaebdb4
Summary:
Delay updating the working copy until after the transaction that created the
obsshelve commit has completed. This means we won't update away from the
user's changes until after their work is safe, so if the update is interrupted
for any reason, the user will be able up do a clean update and then unshelve to
get their work back.
Reviewed By: liubov-dmitrieva
Differential Revision: D10102089
fbshipit-source-id: 5709d3915a6c458ba7cfb37ba5e0be5c6e8fcbb2
Summary:
If the `update` step is interrupted, then the transaction that created the
obsshelve commit is rolled back, but the update can't be rolled back, so the
files that have been shelved are lost.
Reviewed By: liubov-dmitrieva
Differential Revision: D10102088
fbshipit-source-id: f5bcac5c92069cc6ff3d1d9b7fb7ee507003d8eb
Summary:
This is for sandcastle and other automated tools.
They will not need to run extra commands like hg log after amend to learn new
hash.
Reviewed By: markbt
Differential Revision: D10101887
fbshipit-source-id: 7c9931776a03f4335bdfe0a19e7d569e3dc4c4ba