D11613: rhg: refactor function to relativize paths in utils

2021-10-05 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Commands like `files`, `status` supports printing relative paths. Hence we need to re-use this code in other places too. So let's take this out from `rhg

D11614: rhg: add relative paths support in `rhg status`

2021-10-05 Thread pulkit (Pulkit Goyal)
pulkit 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/D11614 AFFECTED FILES rust/rhg/src/commands/status.rs CHANGE DETAILS diff --git

D11610: largefiles: pass current transaction to `lfdirstate.write()`

2021-10-05 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Right now, the largefile dirstate is not included in transaction which makes things complex. Next patch will add code to do so, so let's make it mandatory to

D11612: largefiles: partially undo 61e526585b20e2ff15f19497d0451d18fea02db8 and child

2021-10-05 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Since the largefiles dirstate is now part of transaction, we get rid of this temporary fix which lived for ~7 years. REPOSITORY rHG Mercurial BRANCH

D11611: largefiles: add tr backup for largefilesdirstate

2021-10-05 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This will help us in automatically restoring the largefilesdirstate if a transaction is rolled back. REPOSITORY rHG Mercurial BRANCH default REVISION

D10913: rhg: refactor relative path resolution in utility fn

2021-06-25 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The same code is being used in `rhg files` and `rhg status` and I expect it to be used at more places in upcoming future. So let's have a utility function for

D10912: rhg: add ui.plain() and check it before showing relative paths in status

2021-06-25 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Adds a very basic replica of `ui.plain()`. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10912 AFFECTED FILES

D10911: rhg: add relative path output functionality in status command

2021-06-25 Thread pulkit (Pulkit Goyal)
pulkit 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/D10911 AFFECTED FILES rust/rhg/src/commands/status.rs CHANGE DETAILS diff --git

D10910: rhg: refactor code a little around printing of relative paths

2021-06-25 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY It's easier to understand when setup to compute relative path is decoupled from actual iteration over list of files. REPOSITORY rHG Mercurial BRANCH

D10906: rhg: fallback if tweakdefaults or statuscopies is enabled with status

2021-06-24 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY `rhg status` is experimental right now and does not support all functionalities. While the long term target is to implement them, for now we add a fallback to

D10838: rhg: add exit code to HgError::Abort()

2021-06-07 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY My previous attempts to have rhg end with correct exit code was more of bug hunting. I found cases which were failing and fixed them. But as one might expect,

D10839: rhg: propogate error coming from HgError::Abort to CommandError

2021-06-07 Thread pulkit (Pulkit Goyal)
pulkit 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/D10839 AFFECTED FILES rust/rhg/src/error.rs tests/test-globalopts.t CHANGE

D10837: rhg: split non_repo_config and `--config` loading in different functions

2021-06-07 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This will help us in better handling of error caused when trying to load `--config` values. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10767: rhg: look for repository in ancestors also instead of cwd only

2021-05-24 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Last patch introduced config reading at startup to parse value of `--repository` flag. However, that patch only tried to check for current repository at

D10296: rhg: try read [paths] for `--repository` value

2021-04-02 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY hg parses -R and --repository CLI arguments "early" in order to know which local repository to load config from. (Config can then affect whether or how to

D10254: rhg: raise wdir specific error for `hg debugdata`

2021-03-23 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Helps remove the conditional in `test-debugcommands.t` for rhg. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10253: rhg: add support for detailed exit code for ConfigParseError

2021-03-23 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This patch adds basic support for detailed exit code to rhg with support for ConfigParseError. For now, if parsing the config results in error, we silently

D10149: commit: get info from mergestate whether a file was merged or not

2021-03-10 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: durin42. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY While commiting a merge, the commit code does not know whether a file was merged during `hg merge` or not. This leads the

D10148: mergestate: don't pop stateextras when there are no conflicts on filemerge

2021-03-10 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Even if `filemerge.filemerge()` didn't result in conflicts, we should not remove stateextras for a file since we now use that for more things than just merge

D10147: commit: reorder if-else conditional to give mergestate info priority

2021-03-10 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Looking at the code now, I was unable to find a good reason as why we only rely on mergestate extras info after checking whether a filelog parent is ancestor

D10116: commit: reorder if-else conditional to give mergestate info priority

2021-03-05 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Looking at the code now, I was unable to find a good reason as why we only rely on mergestate extras info after checking whether a filelog parent is ancestor

D10083: tags: validate nodes in _getfnodes() and update cache in case of unknown nodes

2021-03-01 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY `hgtagsfnodescache` can contain unknown nodes due to cache corruption and this lead to a traceback on operations like `hg tags` as we don't validate nodes.

D10015: debugtagscache: verify that filenode is correct

2021-02-17 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Previous patch from Matt demonstrates that `debugtagscache` does not warn about filenode being invalid which can be caused by a corrupted cache. We start

D10018: tags: update the hgtagsfnodes cache if invalid file nodes are found

2021-02-17 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The cache update happens but it happens post calculation of alltags and hence we still don't get correct list of tags in current run. Next patch will try to

D10014: debugcommands: prevent using `is False`

2021-02-17 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY I was touching this code in a future patch and marmoute warned about usage of `is False` here. Quoting marmoute: "is False" is going to check if the

D10017: tags: return set of invalid nodes from _tagsfromfnodes()

2021-02-17 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We pass a list of file nodes to that function but some can be invalid because they were read from a cache which was corrupted. This patches catches

D10016: tags: return tag cache source from _readtagcache()

2021-02-17 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY If the cache is invalid, _readtagcache() can return data which has a wrong filenode. We want to fix the cache in such cases by replacing the wrong filenode

D10013: hgtagsfnodes: refactor code to compute fnode into separate fn

2021-02-17 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY I plan to use this code at one more place while fixing a bug caused by an invalid fnode present in cache. REPOSITORY rHG Mercurial BRANCH default REVISION

D9994: error: remove shortening of node in error message

2021-02-15 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: durin42. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This makes it difficult to figure what exactly was node on which LookupError was called if we only have the error message.

D9992: upgrade: speed up when we have only nodemap to downgrade

2021-02-15 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Similar to what we do on upgrade, if we have only persistent-nodemap to downgrade we will just delete the nodemap files and update repository requirements

D9991: upgrade: write nodemap for manifests too

2021-02-15 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY In 98e39f04d60e I assumed that writing nodemap for manifests was not desirable and

D9936: upgrade: implement partial upgrade for upgrading persistent-nodemap

2021-01-31 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Upgrading repositories to use persistent nodemap should be fast and easy as it requires only two things: 1. Updating the requirements 2. Writing a

D9933: revlog: refactor logic to compute nodemap file in separate function

2021-01-31 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY I will like to use it one more place. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D9930: debugcommands: s/stdin/stdout in debugnodemap help

2021-01-31 Thread pulkit (Pulkit Goyal)
pulkit 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/D9930 AFFECTED FILES mercurial/debugcommands.py CHANGE DETAILS diff --git

D9935: tests: unquiet a test to show changes in next patch

2021-01-31 Thread pulkit (Pulkit Goyal)
pulkit 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/D9935 AFFECTED FILES tests/test-persistent-nodemap.t CHANGE DETAILS diff --git

D9934: nodemap: fix a typo in error message

2021-01-31 Thread pulkit (Pulkit Goyal)
pulkit 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/D9934 AFFECTED FILES mercurial/revlogutils/nodemap.py CHANGE DETAILS diff --git

D9932: nodemap: make `_persist_nodemap` a public function

2021-01-31 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY I will like to have a utility function using which we can directly write out nodemap for a repository without going through the recloning process. This

D9931: engine: 'if not, else' -> 'if, else'

2021-01-31 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY I personally feel that if x: pass else: pass is easier to read and edit than if not x: pass else: pass

D9824: share: make different options for upgrade and downgrade share-safe

2021-01-18 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This makes things more configurable. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9824 AFFECTED FILES

D9823: share: move share safe functionality out of experimental

2021-01-18 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. pulkit updated this revision to Diff 25119. REVISION SUMMARY The share-safe functionality is complete and all configuration options are implemented. The behavior is well

D9822: upgrade: re-read current requirements after taking lock

2021-01-18 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Since we are writing to repository, it's better to re-read after taking the lock. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D9786: share: rename share-safe warning config

2021-01-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Config introduced in previous patch was `share.source-safe-mismatch`. Let's rename the warn as `share.source-safe-mismatch.warn`. REPOSITORY rHG Mercurial

D9785: share: collapse 3 different bool configs into one enum config

2021-01-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Recently I implemented various boolean configs which control how to behave when there is a share-safe mismatch between source and share repository. Mismatch

D9784: localrepo: disallow share if there is a version mismatch by default

2021-01-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Earlier we used to allow shares which don't use share-safe mechanism to access repository which uses share-safe mechanism. This defeats the purpose and is bad

D9783: upgrade: take lock only for part where it's required

2021-01-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The final config calculation code does not require a lock, only writing it back does require one. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D9775: upgrade: update only requirements if we can

2021-01-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Upgrade operations which involves just upgrading requirements earlier used to go through whole revlog cloning business. Now we just upgrade the requirement

D9774: engine: add `if True` to prepare for next patch

2021-01-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This will help making next patch easier to read. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9774 AFFECTED

D9773: test: unquiet few tests to demonstrate changes in upcoming patches

2021-01-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Upcoming patches will skip revlog cloning for share-safe upgrades. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D9770: upgrade: don't create store backup if `--no-backup` is passed

2021-01-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY If the user explicitly mentioned that they don't need backup, then let's not create it. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D9772: upgrade: mark sharesafe improvement as only touching requirements

2021-01-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Upgrading the repository to use share safe functionality only touches requirements. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D9771: actions: calculate what all parts does the operation touches

2021-01-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY To make upgrade work less in certain situations, we need to teach it to find out what all parts of repository current operation is touching. This patch

D9769: share: add documentation about various configs introduced recently

2021-01-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY My recent series added these 4 configs which control how to behave when there is difference in share-safe state of source and shares. However my patches were

D9747: largefiles: remove unused imports

2021-01-13 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This fixes test-check-pyflakes.t REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9747 AFFECTED FILES

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

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

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

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

D9681: localrepo: move storevfs calculation out of if statement

2021-01-06 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY In next patch, we will need this variable in else statement too. So, let's take it out. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D9680: sharesafe: add functionality to automatically downgrade shares

2021-01-06 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Reasoning is same as previous patch which adds automatic upgrade support. Downgrade is required as if automatic upgrade is enabled, all shares upgrade and

D9679: sharesafe: introduce functionality to automatically upgrade shares

2021-01-06 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY In past few months, we have developed a `share-safe` mode for sharing repository in which share source requirements and config values are shared with the

D9677: upgrade: use copy+delete instead of rename while creating backup

2020-12-31 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY A lot of times, we do an upgrade operation which does not touches all the parts of the stores. But right not, we have a blind logic which processes everything.

D9676: upgrade: migrated -> upgraded in ui messages

2020-12-31 Thread pulkit (Pulkit Goyal)
pulkit 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/D9676 AFFECTED FILES mercurial/upgrade.py mercurial/upgrade_utils/engine.py

D9675: upgrade: remove unnecessary `is None` check

2020-12-31 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY `upgrade_engine.upgrade()` always return the `backuppath` value and there are not early returns. Hence I don't see how `backuppath` can be None. Adding

D9674: engine: refactor code to replace stores in separate function

2020-12-31 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY In not all upgrades, we need to change the whole store. For example, when upgrading repository to share-safe mode, we don't touch revlogs at all hence store

D9673: engine: prevent a function call for each store file

2020-12-31 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Python function calls are not cheap. Instead of calling the function once for each file in store, we use a dedicated function which filters and yields the

D9672: engine: make hook point for extension a public function

2020-12-31 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Well there are no private public functions in Python, but we generally treat functions and variables starting with `_` as private ones. A function which

D9669: engine: prevent multiple checking of re-delta-multibase

2020-12-30 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The _perform_clone function is called for each revlog cloned, hence we should prevent this function call overhead. REPOSITORY rHG Mercurial BRANCH default

D9668: engine: pass upgrade operation inside `_perform_clone()`

2020-12-30 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Same as previous patch. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9668 AFFECTED FILES

D9667: engine: pass upgrade operation inside _clonerevlogs()

2020-12-30 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Better to pass the operation instead of passing three of it's members (one of the them is a function call) separately. This will also be useful in future

D9666: actions: store deltareuse mode of whole operation in UpgradeOperation

2020-12-30 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY UpgradeOperation should provide easy access to all the things related to the current operation. Clients should not need to compute them. REPOSITORY rHG

D9665: engine: refactor how total dstsize is calculated

2020-12-30 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Instead of increasing it with each revlog, we just get the sum of total destination changelog, manifest and filelogs sizes. REPOSITORY rHG Mercurial BRANCH

D9664: actions: rename DEFICIENCY constant to FORMAT_VARIANT

2020-12-30 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY It was not obvious what does deficieny means and every format change can't be a deficiency. There are some format changes like compression levels, share-safe

D9617: debugupgraderepo: minor documentation fix

2020-12-16 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY When we specify `--no-changelog --no-manifest --no-filelog` we skip all revlog optimization instead of all filelog optimization. Also while I was here, for

D9614: upgrade: drop support for old style optimization names

2020-12-16 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Old style optimization names like `redeltaparent` were converted into `re-delta-parent` more than two years ago. The old names were kept around for sometime

D9619: upgrade: introduce post upgrade and downgrade message for improvements

2020-12-16 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY For certain imporvements, we will like to show a message after the operation completed. This patch introduces that functionality. Right now it's only used

D9618: actions: introduce function to calculate downgrades

2020-12-16 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY An ugrade operation can also downgrade/remove some format variants. Before this patch there was no clean way to find out all such variants which will be

D9616: upgrade: rename actions to upgrade_actions

2020-12-16 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The `actions` were a list of optimizations and format ugrades which will be upgraded. This does not include things which will be downgraded. Let's rename

D9615: upgrade: move optimization addition to determineactions()

2020-12-16 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The documentation of `determineactions()` mention that it is given a list returned from `findoptimizations()` however it was not true before this patch. The

D9583: upgrade: add a missing space in status message

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Found while reading the code to refactor. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9583 AFFECTED FILES

D9582: upgrade: rename deficiences to format_upgrades

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY It was not obvious what does deficieny means and every format upgrade can't be a deficiency. There are some format upgrades like compression levels, share-safe

D9580: engine: unwrap a hard to understand for loop

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The loop was iterating over all the datafiles and maintaining a set to check whether filelogs have been processed, manifests have been processed or not. The

D9579: engine: refactor actual cloning code into separate function

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The `for ...` under which this cloning code exists is too complicated and based on certain assumptions. I am going to refactor it in next patches and make it

D9578: upgrade: move printing of unused optimizations to UpgradeOperation class

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit 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/D9578 AFFECTED FILES mercurial/upgrade.py mercurial/upgrade_utils/actions.py

D9577: upgrade: move `printrequirements()` to UpgradeOperation class

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Part of refactor where we make things more arranged and integrated into single `UpgradeOperation` class. REPOSITORY rHG Mercurial BRANCH default REVISION

D9576: upgrade: move `printoptimisations() to UpgradeOperation class

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Part of refactor where we make things more arranged and integrated into single `UpgradeOperation` class. REPOSITORY rHG Mercurial BRANCH default REVISION

D9575: upgrade: move `printupgradeactions()` to UpgradeOperation class

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Part of refactor where we make things more arranged and integrated into single `UpgradeOperation` class. REPOSITORY rHG Mercurial BRANCH default REVISION

D9574: upgrade: move `print_affected_revlogs()` to UpgradeOperation class

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Part of refactor where we make things more arranged and integrated into single `UpgradeOperation` class. REPOSITORY rHG Mercurial BRANCH default REVISION

D9570: debugcommands: introduce command to upgrade/downgrade shares

2020-12-12 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY In past few months, we have developed functionality to share requirements and configs of share-source and a way to upgrade repository from old format to

D9571: debugsharesafe: recommend from `debugupgraderepo` and `help -e share -v`

2020-12-12 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Recommending one debug command from another one sounds fine to me. Also documentation about share-safe in `hg help -e share -v` was lacking correct

D9569: contrib: run python3+chg tests too in heptapod CI

2020-12-12 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Recent patches made the CI on python3+chg green. Let's enable this before there are more failures to fix. REPOSITORY rHG Mercurial BRANCH default

D9568: scmutil: improve documentation of writereporequirements()

2020-12-12 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This makes it easier to understand the difference between `writerequires()` and `writereporequirements()`. REPOSITORY rHG Mercurial BRANCH default

D9517: commandserver: handle IOError related to flushing of streams

2020-12-04 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY After dispatch, without chg we have handling of flushing of streams and exception handling related to it. The exception handling part is important because

D9502: tests: conditionalize output in test-ssh.t with chg+py3

2020-12-02 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Because of our wrapping around sys.std* and python3 internal buffering, the output order changes. The change in order seems like harmless because just few

D9501: dispatch: disable line ending normalization on sys.stdin if its None

2020-12-02 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Fixes test-chg.t on python 3 with chg. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D9501 AFFECTED FILES mercurial/dispatch.py

D9500: procutils: don't try to get `.buffer` if sys.stdin is None

2020-12-02 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY While hunting down following test failure of test-chg.t on Python 3, I stumbled the case when `.buffer` is not available as sys.stdin is None. -

D9463: tests: conditionalize return code on chg in test-config.t

2020-11-30 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY If there is any error while reading config, chg just returns 255 instead of 30. It seems to me that we cannot conditionalize only return codes in output

D9462: chgserver: catch RepoError while loading configuration

2020-11-30 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Recent share safe work introduced functionality to read share source config file on dispatch. This can result in RepoError while reading config file as the

D9414: tests: update test-chg.t with output change

2020-11-27 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Since this part of tests is only run with chg, hence it didn't get updated when the error message changed. REPOSITORY rHG Mercurial REVISION DETAIL

  1   2   3   4   5   6   7   8   9   10   >