- Jan 09, 2021
-
-
Martin von Zweigbergk authored
We assumed that the files in the `.hg/shelved/` directory have an extension. That's a valid assumption except that users may put garbage in the directory. This patch fixes the crash by simply not assuming that the result of splittin a string at '.' yields an extension. We don't use the extension since the previous patch anyway. Differential Revision: https://phab.mercurial-scm.org/D9720
-
- Jan 11, 2021
-
-
Martin von Zweigbergk authored
Before this patch, if a shelved change is missing its `.hg` file, we still list it in `hg shelve --list`, but then `hg unshelve` crashes. This patch makes it so we only list valid shelved changes. This patch means that users who do `touch .hg/shelve/buy-milk.patch` as a form of TODO list will no longer see their TODO items in `hg shelve --list`. Differential Revision: https://phab.mercurial-scm.org/D9719
-
- Jan 08, 2021
-
-
Martin von Zweigbergk authored
This just looks cleaner to me; I'd be surprised if there's any measurable performance improvement. Differential Revision: https://phab.mercurial-scm.org/D9714
-
Martin von Zweigbergk authored
This removes the only remaining use for `shelvedfile`, so the class now goes away. Differential Revision: https://phab.mercurial-scm.org/D9713
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D9712
-
Martin von Zweigbergk authored
When I saw `gennames()`, I thought it was meant to take a relative filename as argument. Maybe it was or maybe it wasn't, but it seems simpler to pass it a relative path anyway, so that's what this patch does. That also makes the call to backupvfs.exists() more natural (I expect a relative path to be passed there too). Differential Revision: https://phab.mercurial-scm.org/D9711
-
Martin von Zweigbergk authored
The point of this patch is to make it so all the callers of `shelvedfile.movetobackup()` look the same, so I can move it over to the new `Shelf` class next. Differential Revision: https://phab.mercurial-scm.org/D9710
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D9709
-
- Jan 07, 2021
-
-
Martin von Zweigbergk authored
All three callers now prefer the shelf name over the filename (already before my recent patches, two out of three callers preferred the shelf name). Differential Revision: https://phab.mercurial-scm.org/D9708
-
Martin von Zweigbergk authored
Only the mtime was needed, so I made it restricted to that in the move. The new `Shelf` class expects its argument to be a shelf name (not a arbitrary filename like `shelvedfile` would accept), so only the shelf name is now passed in. Differential Revision: https://phab.mercurial-scm.org/D9707
-
Martin von Zweigbergk authored
For some reason the existing code didn't use `shelvedfile().opener()` so here we migrate to `shelf().open_patch()` from the `open()` system call instead. Differential Revision: https://phab.mercurial-scm.org/D9706
-
Martin von Zweigbergk authored
The `opener()` method was used specifically for the `.patch` file, and the new `Shelf` class deals with all files involved in a shelf, so I renamed the function in the process. Differential Revision: https://phab.mercurial-scm.org/D9705
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D9704
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D9703
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D9702
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D9701
-
Martin von Zweigbergk authored
I'm about to make phase-based shelve not write `.hg` and `.patch` files. Having a class that represents a single shelf, regardless of which files it uses will help. I'm starting small with just a `.exists()` function. I plan to eventually remove the `shelvedfile` class once all functionality has been moved to the new class. By the way, I know that things you shelve are not typically themselves shelves. I still picked `Shelf` for the class because it's short (compared to e.g. `ShelvedChange`). Differential Revision: https://phab.mercurial-scm.org/D9700
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D9699
-
Martin von Zweigbergk authored
The only place we call `shelvedfile.opener()` is when we're about to apply a bundle. The file should always exist. If it doesn't, the `.hg/` directory is corrupt and we don't provide any guarantees about supporting corrupt repos (besides, telling the user that the shelve doesn't exist when `hg shelve --list` lists it is not very helpful). Differential Revision: https://phab.mercurial-scm.org/D9698
-
Martin von Zweigbergk authored
The code would try to delete the shelf's .patch file and if that raised an exception, it would convert it to an `error.Abort`. This patch rewrites it so the check is done upfront. I find it easier to read that way. It's now clear enough that I removed the comment explaining it as well. As Joerg pointed out during review, another differences is that the old code would move a `.hg` file without its `.patch` friend to backup before it realized that the `.patch` file was missing. The new code will error out earlier and not move the `.hg` file, which seems like an improvement. That should only matter on corrupt `.hg/shelved/` directories, however. Differential Revision: https://phab.mercurial-scm.org/D9697
-
Martin von Zweigbergk authored
It was added in 43816070284e (shelve: add a bundlerepo method, 2014-10-10), but I haven't been able to find a place it was used. Differential Revision: https://phab.mercurial-scm.org/D9696
-
- Jan 09, 2021
-
-
Martin von Zweigbergk authored
I don't care much how we behave in these cases, except that we should provide a way for the user to get out of the broken state. Differential Revision: https://phab.mercurial-scm.org/D9718
-
- Jan 13, 2021
-
-
Pierre-Yves David authored
This allow code to access the expected value for a config. This is useful in the context of dynamic default value, and short term it will be useful to write dynamically "correct" code. Differential Revision: https://phab.mercurial-scm.org/D9759
-
- Jan 14, 2021
-
-
Pierre-Yves David authored
That test is quite slow, lets split it in smaller bits. Differential Revision: https://phab.mercurial-scm.org/D9768
-
Pierre-Yves David authored
This open the way to splitting this slow test in multiple ones. Differential Revision: https://phab.mercurial-scm.org/D9767
-
- Jan 15, 2021
-
-
Pierre-Yves David authored
We need more than the python module, we also need the sqlite3 command line. Differential Revision: https://phab.mercurial-scm.org/D9787
-
Jörg Sonnenberger authored
Differential Revision: https://phab.mercurial-scm.org/D9782
-
- Jan 14, 2021
-
-
Martin von Zweigbergk authored
Command errors (unknown or ambiguous commands, or bad command arguments or options) are handled in the `dispatch` module. Most other errors are handled in the `scmutil` module. This patch therefore has to duplicate a little bit of code from the `scmutil` module. It's just a few lines, however, so it seems fine to me. It's a pretty common category of errors, so it's important to have them respect `ui.detailed-exit-code`. Differential Revision: https://phab.mercurial-scm.org/D9777
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D9776
-
- Jan 15, 2021
-
-
Augie Fackler authored
The former was deprecated in 3.9.0. Differential Revision: https://phab.mercurial-scm.org/D9791
-
Augie Fackler authored
This is actually what we already do on oss-fuzz, so it's more correct as tests go. Differential Revision: https://phab.mercurial-scm.org/D9790
-
- Jan 14, 2021
-
-
Pierre-Yves David authored
Since issue6150 is still not fixed, we have to accommodate a larger array of possible results. Otherwise we get frequent flakiness of local and CI runs. Differential Revision: https://phab.mercurial-scm.org/D9766
-
- Jan 13, 2021
-
-
Augie Fackler authored
Also only under python 3. Differential Revision: https://phab.mercurial-scm.org/D9752
-
- Jan 08, 2021
-
-
Raphaël Gomès authored
This feature will be replaced in a few months, and served more as a proof-of-concept. Keeping it in CI when no one is using it anymore is just wasteful. Differential Revision: https://phab.mercurial-scm.org/D9716
-
- Jan 13, 2021
-
-
Pierre-Yves David authored
I am not sure why this `str` all is there is the first place. Differential Revision: https://phab.mercurial-scm.org/D9751
-
- Dec 18, 2020
-
-
Jörg Sonnenberger authored
The branchhead computation is one of the more heavy operations for bigger repositories as it has to scan all changesets and potentially involves the expensive computation of the ancestor sets. Redo the computation to handle the common cases directly and use tighter conditions for when the ancestor scan is necessary. Most importantly, avoid it completely if the non-continous branches are processed in one update as seen in the initial computation after a clone. For the Mercurial repository, it gives a small 2-3% performance boost. For the NetBSD test repository, it cuts the time in half. Differential Revision: https://phab.mercurial-scm.org/D9631
-
- Jan 12, 2021
-
-
Pierre-Yves David authored
This make sure they are will be selected during upgrade, and copy based clone. Differential Revision: https://phab.mercurial-scm.org/D9749
-
- Jan 13, 2021
-
-
Pierre-Yves David authored
We do not want to exclude `.d` we want to only include `.i`. We are about to add more extension type (for the persistent nodemap: `.n`, `.nd`) so lets make the list explicit instead. Differential Revision: https://phab.mercurial-scm.org/D9748
-
- Jan 12, 2021
-
-
Pierre-Yves David authored
We have a local work-around, however having that data sent in the first place would be better. So we start with a test that monitor what is sent, and notice they are not. Differential Revision: https://phab.mercurial-scm.org/D9736
-
Pierre-Yves David authored
This is currently buggy. We add a test before fixing the bug. Differential Revision: https://phab.mercurial-scm.org/D9734
-