rewriteutil: add a precheck function to check if revs can be rewritten
The precheck function is intended to be used before we start rewritting
changesets.
Differential Revision: https://phab.mercurial-scm.org/D1503
rewriteutil: add utility function to check if we can create new unstable cset
This patch adds a new file which will contain utility functions related to
rewritting changesets. It also adds a utility function to check if the
rewritting operation creates new unstable changesets and are we allowed to
create them.
This rewriteutil.py introduced in this patch and the utility functions added in
the upcoming patches exists in the evolve extension are being ported from there.
Differential Revision: https://phab.mercurial-scm.org/D1502
test-run-tests: do not rebuild hg in the test
d600bda4 and
fc0f3ed0 added code to call `$PYTHON run-tests.py ...`. That
will rebuild hg, is slow and could have other crashes from setup.py, like:
Unable to find a working hg binary to extract the version from the
repository tags
Therefore use `run-tests.py -l` instead.
Differential Revision: https://phab.mercurial-scm.org/D1595
remotenames: consider existing data while storing newer data
Previously reviewed as D1357.
Differential Revision: https://phab.mercurial-scm.org/D1551
remotenames: add functions to read remotenames data from .hg/remotenames/
This patch functions which can be used to read remotenames data from
.hg/remotenames/. The logic for the function which reads the remotenames file is
taken from the remotenames extension.
Previously reviewed as D940.
Differential Revision: https://phab.mercurial-scm.org/D1550
remotenames: add test showing overwriting on remotenames data
The current storage logic every time overwrites the existing data with the new
data. This patch adds test to demonstrate that. To fix this, we need to add
logic to read existing remotenames data and merge with existing data which will
be added in upcoming changesets.
Previously reviewed as D1356.
Differential Revision: https://phab.mercurial-scm.org/D1549
remotenames: add functionality to store remotenames under .hg/hgremotenames/
This patch moves the functionality from remotenames extension to store
remotenames to core.
Storage format used by remotenames extension:
A single file `.hg/remotenames` with an entry in each line where each line is of
format:
`node nametype remotepath/name`
where nametype is either 'bookmarks' or 'branches'.
This was not the best way to store data, so while moving to core the storage
format was changed but yet not the final format. The storage format used by core
after this patch will be:
* A file for each type of name i.e. bookmarks and branches in .hg/remotenames/
directory
* A version number on the top of the file. The version for current format is 0.
* An entry in each line where each line is of the format
`node\0remotepath\0name`
The logic to sync with existing remotenames file and saving journals and other
related things will be moved to core in next patches incrementally.
Thanks to Ryan, Augie and Durham for suggestions on storage format.
Previously reviewed as D939.
Differential Revision: https://phab.mercurial-scm.org/D1548
remotenames: move function to pull remotenames from the remoterepo to core
This patch is the first patch of the series moving functionality from
hgremotenames extension to core.
There are lot of functionality in the extension which in the end enables us to
store branch heads and bookmarks location on a server from which we are pulling
or cloning from. This will help us in creating a better bookmark workflow where
we can show user that a certain server has this bookmarks at this node. It will
also introduce namespaces related to remote bookmarks and remote branches.
This patch moves the functionality to pull branches and bookmarks from a
server from which we are pulling to core behind config option
`experimental.remotenames`.
This patch adds a test which helps us to analyse whether things are working or
not. We are currently writing things to ui, we will write information to files
in upcoming patches.
Previously reviewed as D937.
Differential Revision: https://phab.mercurial-scm.org/D1547