D9715: convert: set date and time for svn commits

2021-01-08 Thread nslsrv (Nikita Slyusarev)
nslsrv created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Committing to subversion repository is changed to use commit dates from the source. Subversion always uses commit dates with UTC timezone, so only timestamps ar

D9714: shelve: extract some repeated creation of shelf instances to variables

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This just looks cleaner to me; I'd be surprised if there's any measurable performance improvement. REPOSITORY rHG Mercurial BRANCH default REVISION DET

D9713: shelve: teach new shelf class to check if .shelve file exists

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This removes the only remaining use for `shelvedfile`, so the class now goes away. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://ph

D9712: shelve: move method for creating backup to new shelf class

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9712 AFFECTED FILES mercurial/shelve.py CHANGE DETAILS diff --git a/mercurial/

D9710: shelve: use listshelves() in cleanup function

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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.

D9708: shelve: make listshelves() return shelf names instead of filenames

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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). REPOSI

D9711: shelve: make gennames() helper generate relative backup paths

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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

D9709: shelve: inline shelvedfile.filename() since there are no callers outside class

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9709 AFFECTED FILES mercurial/shelve.py CHANGE DETAILS diff --git a/mercurial/

D9707: shelve: move method for getting stat (mtime) to new shelf class

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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

D9706: shelve: open patch using new shelf class instead of open()

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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. R

D9705: shelve: move function for opening .patch file to new shelf class

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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 func

D9703: shelve: move method for writing bundle to new shelf class

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9703 AFFECTED FILES mercurial/shelve.py CHANGE DETAILS diff --git a/mercurial/

D9704: shelve: move method for reading .hg to new shelf class

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9704 AFFECTED FILES mercurial/shelve.py CHANGE DETAILS diff --git a/mercurial/

D9702: shelve: move method for reading .shelve file to new shelf class

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9702 AFFECTED FILES mercurial/shelve.py CHANGE DETAILS diff --git a/mercurial/

D9699: shelve: raise more specific errors

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9699 AFFECTED FILES mercurial/shelve.py tests/test-shelve.t CHANGE DETAILS d

D9701: shelve: move method for writing .shelve to new shelf class

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9701 AFFECTED FILES mercurial/shelve.py CHANGE DETAILS diff --git a/mercurial/

D9700: shelve: introduce class representing a shelf

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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 wi

D9698: shelve: trust caller of shelvedfile.opener() to check that the file exists

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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 co

D9697: shelve: rewrite check for unknown shelf to delete

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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

D9696: shelve: remove a bundlerepo method

2021-01-08 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY It was added in 43816070284e (shelve: add a bundlerepo method, 2014-10-10), but

D9695: upgrade: don't perform anything if nothing to do

2021-01-08 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Before this patch, upgrade will process everything, re-clone all revlogs, write requirements file again even there is no change to be made. This patch makes

D9693: downgrade: if a compression is removed, consider that too

2021-01-08 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY For compression format variant, the result of `fromrepo()` and `fromconfig()` is not a boolean and we have to actually equate those to find change. REPOSITORY

D9694: upgrade: demonstrate that a no-op upgrade still performs everything

2021-01-08 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY An upgrade operation which is not adding or removing anything should ideally error out. However, it does the whole cloning and everything. Next patch will fix i

D9692: sharesafe: introduce config to disallow outdated shares from working

2021-01-08 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY After this patch, we have config option to control all aspects of shares when share source is upgraded or downgraded. REPOSITORY rHG Mercurial BRANCH defaul

D9691: sharesafe: make warning about outdated share configurable

2021-01-08 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY If the source repository upgrades to use sharesafe mode, we show a warning in shares. This patch makes that warning configurable and some might not want their

D9690: debuglock: rename flag names to better clarity

2021-01-08 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY `--force-lock` sounds as if we are taking the lock however in reality it's the opposite. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://