Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Console View

Legend:   Passed Failed Warnings Failed Again Running Exception Offline No data

Martin von Zweigbergk
revert: remove dangerous `parents` argument from `cmdutil.revert()`

As we found out the hard way (thanks to spectral@ for figuring it
out!), `cmdutil.revert()`'s `parents` argument must be
`repo.dirstate.parents()` or things may go wrong. We had an extension
that passed in the target commit as the first parent. The `hg split`
command from the evolve extension seems to have made the same mistake,
but I haven't looked carefully.

The problem is that `cmdutil._performrevert()` calls
`dirstate.normal()` on reverted files if the commit to revert to
equals the first parent. So if you pass in `ctx=foo` and
`parents=(foo.node(), nullid)`, then `dirstate.normal()` will be
called for the revert files, even though they might not be clean in
the working copy.

There doesn't seem to be any reason, other than a tiny performance
benefit, to passing the `parents` around instead of looking them up
again in `cmdutil._performrevert()`, so that's what this patch does.

Differential Revision: https://phab.mercurial-scm.org/D8925
Pulkit Goyal
localrepo: move requirements constant to requirements module

We now have a dedicated module for requirements constant, let's move the ones in
localrepo there.

Differential Revision: https://phab.mercurial-scm.org/D8918
Pulkit Goyal
requirements: introduce a set of working directory specific requirements

Some requirements like the SPARSE_REQUIREMENT is working directory specific and
cannot be shared. We add a set which will contain all these requirements.

This is not the best we can do, I think having a rich requirement class will be
much better but that will be out of scope for this series.

Differential Revision: https://phab.mercurial-scm.org/D8924
Pulkit Goyal
requirements: introduce new requirements related module

It was not clear where all requirements should and related APIs should be, this
patch introduces a requirements module which will have all exitsing requirements
and related APIs.

Differential Revision: https://phab.mercurial-scm.org/D8917
Pulkit Goyal
repository: introduce constant for treemanifest requirement and use it

In future we will like to much cleaner logic around which requirement is for
working copy and which can go in store. To start with that, we first need to
de-clutter the requirement values spread around and replace them with constants.

Differential Revision: https://phab.mercurial-scm.org/D8916
C├ędric Krier
keepalive: Do not append _rbuf if _raw_readinto exists (issue6356)

The readline method append to the chunks the content of the _rbuf then there
is a loop that call _raw_read which on Python3 call readinto. But the readinto
version in mercurial append again the _rbuf content. So this creates the
duplicate content. This does not happen in Python2 because _raw_read does not
call readinto.

Differential Revision: https://phab.mercurial-scm.org/D8859
Kyle Lippincott
tests: make test-install.t work on debian systems

Debian systems, at least as of their version of python3.8 on my machine, have
rewritten some logic in ensurepip to make it not use the wheels in pip._bundled,
but instead to use wheels installed in /usr/share/python-wheels. It copies these
wheels into the virtual environment when it's created, and installenv/bin/pip is
able to see them and use them, so it thinks that 'wheel' is installed, and that
it can build the mercurial wheel instead of just installing it. For some reason,
when it subprocesses to run `python3 setup.py bdist_wheel`, it setup.py does
*not* have the 'wheel' wheel available, and we get an error message.

Differential Revision: https://phab.mercurial-scm.org/D8813
Martin von Zweigbergk
rename: add support for --at-rev, which marks as copy and removes the source

I had previously only added support for `--at-rev` to `hg cp`, but not
to `hg mv`. This patch adds that support. Just like for `hg cp`, it
marks the destination as copied from the source, and doesn't care if
the source file still exists (because it only supports the `-A` mode,
aka "don't touch files" mode). It works whether or not the source file
still exists. This matches the behavior of `hg mv -A` in the working

Differential Revision: https://phab.mercurial-scm.org/D8840
Joerg Sonnenberger
tests: make flag parsing test more future safe

The revlog format contains a number of feature flags, e.g. if general
deltas are active. When testing that unknown flags are rejected, use
bits that are not immediately following the currently used bits.

Differential Revision: https://phab.mercurial-scm.org/D8782
Antoine Cezar
rhg: extract function handle_stdout_error

Avoid repeating the logic of handling stdout write errors.

Differential Revision: https://phab.mercurial-scm.org/D8870
Antoine Cezar
rhg: add a `Files` `Command` to prepare the `rhg files` subcommand

Differential Revision: https://phab.mercurial-scm.org/D8868
Antoine Cezar
hg-core: make parse_dirstate return references rather than update hashmaps

Returing a vec is faster than updating a hashmap when the hashmap is not needed
like in `hg files` which just list tracked files.

Returning references avoid copying data when not needed improving performence
for large repositories.

Differential Revision: https://phab.mercurial-scm.org/D8861
Antoine Cezar
rhg: simplify `FindRootError` handling

Differential Revision: https://phab.mercurial-scm.org/D8867
Antoine Cezar
hg-core: remove the `Operation` trait

There is no way to currently define a trait which can both return references
to `self` and to passed data, which is what we would need.
Generic Associated Types may fix this and allow us to have a unified interface.
See: rust #44265

Differential Revision: https://phab.mercurial-scm.org/D8862
Antoine Cezar
rhg: add buffered stdout writing possibility

Improve batch stdout writing performance.
At some point line buffered output should be introduced.

Differential Revision: https://phab.mercurial-scm.org/D8866
Antoine Cezar
rhg: add a limited `rhg files` subcommand

Differential Revision: https://phab.mercurial-scm.org/D8869
Antoine Cezar
rhg: handle broken pipe error for stderr

Differential Revision: https://phab.mercurial-scm.org/D8871
Antoine Cezar
hg-core: define a `ListTrackedFiles` `Operation`

List files under Mercurial control in the working directory.

Differential Revision: https://phab.mercurial-scm.org/D8863
Antoine Cezar
rhg: ask the error message from `CommandError`

Avoid repeating the display of the same error messages in different commands.

Differential Revision: https://phab.mercurial-scm.org/D8865
Antoine Cezar
rhg: Do not return error when when we really mean ok in commands

Before when a command was successfull `Err(CommandErrorKind::Ok.into())` was
returned which is an oxymoron. Using `Ok(())` when everything is ok seems more

Differential Revision: https://phab.mercurial-scm.org/D8864
Pulkit Goyal
repository: introduce constant for sparse repo requirement and use it

In future we will like to much cleaner logic around which requirement is for
working copy and which can go in store. To start with that, we first need to
de-clutter the requirement values spread around and replace them with constants.

Differential Revision: https://phab.mercurial-scm.org/D8911
  • hg tests: run-tests.py (python 2.7.10) failed -  stdio
Martin von Zweigbergk
makefile: stop setting unused HGEXTDIR variable during osx build

The variable was added in a38ed42cd23c (osx: include chg by default,
2017-03-20), but I can't find any others references to the variable in
that commit or in any other commits.

Differential Revision: https://phab.mercurial-scm.org/D8915
  • hg tests: run-tests.py (python 2.7.10) failed -  stdio
Pulkit Goyal
localrepo: refactor `.hg/requires` reading logic in separate function

In an upcoming patch, we will be reusing this to read `.hg/store/requires`, so
let's separate it in a different function before.

Differential Revision: https://phab.mercurial-scm.org/D8910
  • hg tests: run-tests.py (python 2.7.10) failed -  stdio
Pulkit Goyal
localrepo: refactor logic to calculate sharedvfs in separate fn

We will be reusing this in an upcoming patch, so better to refactor it into a
separate function. Also the underlying handling deserves a function of it's own.

Differential Revision: https://phab.mercurial-scm.org/D8909
  • hg tests: run-tests.py (python 2.7.10) failed -  stdio
Pulkit Goyal
repository: introduce constant for internal phase repo requirement and use it

In future we will like to much cleaner logic around which requirement is for
working copy and which can go in store. To start with that, we first need to
de-clutter the requirement values spread around and replace them with constants.

Differential Revision: https://phab.mercurial-scm.org/D8912
  • hg tests: run-tests.py (python 2.7.10) failed -  stdio
Pulkit Goyal
store: refactor space delimited list to proper data structure

There is no good reason why are having a space delimited list and then using
`.split()` to get the actual list. Let's convert this into a proper collection.

Differential Revision: https://phab.mercurial-scm.org/D8908
  • hg tests: run-tests.py (python 2.7.10) failed -  stdio
Pulkit Goyal
merge: pass mergeresult obj instead of actions in _checkcollision() (API)

The goal is to not use the actions dict and replace it with a rich mergeresult

Differential Revision: https://phab.mercurial-scm.org/D8875
Pulkit Goyal
merge: replace use of actions dict with mergeresult object

There are still some places which can be improved by having a dedicated API,
this patch for now make all users of actions dict go through the mergeresult
object API.

Differential Revision: https://phab.mercurial-scm.org/D8879
Pulkit Goyal
sparse: replace merge action values with mergestate.ACTION_* constants

Having bytestrings like `b'r'` makes it hard to understand for people who don't
know the code much or looking at it for the first time.

Differential Revision: https://phab.mercurial-scm.org/D8881
Pulkit Goyal
merge: use ACTION_* constants instead of values in _filternarrowactions()

It makes easier to check what noconflicttypes are and which are not included.
I hope we can have a state where we always use ACTION_* constants instead of
these values which are very hard to understand.

Differential Revision: https://phab.mercurial-scm.org/D8885
Pulkit Goyal
mergeresult: add `files()` and use it

`files()` will return a list of files on which an action needs to be performed.

This is a step to stop exposing the underlying map to the user of this object.

Differential Revision: https://phab.mercurial-scm.org/D8887
Pulkit Goyal
mergeresult: yield from getactions() instead of buidling a list and returning

Only 7 out of 29 callers change the underlying dict while iterating. So it's
better to yield and wrap the 7 callers with `list()`.

Differential Revision: https://phab.mercurial-scm.org/D8882
Pulkit Goyal
mergeresult: introduce getfile() and use it where required

We want to hide the underlying dictionary from the users and provide API for
valid and sane use cases.

Differential Revision: https://phab.mercurial-scm.org/D8886
Pulkit Goyal
merge: remove emptyactions() and use collections.defaultdict(list) instead

emptyactions() used to return a dict which was populated and passed into
applyupdates(). However, with recent changes, we no longer pass a plain dict,
instead we pass the mergeresult object.

There was only one usage of emptyactions and that too inside mergeresult object.
That usage is replaced with collections.defaultdict(list) instead.

Not sure why we were not using collections.defaultdict(list) from the beginning.

Differential Revision: https://phab.mercurial-scm.org/D8903
Pulkit Goyal
merge: pass mergeresult obj instead of actions in applyupdates() (API)

This is similar to past 20 patches or so where we are replacing use of a bare
actions dict with a dedicated mergeresult object. The goal is to have a
dedicated powerful object instead of a dict while making the code more easier to
In past few patches, we have already simplified the code at some places using
the newly introduced object.

This patch does not updates applyupdates() to use the mergeresult object
directly. That will be done in next patch to make things easier to review.

Differential Revision: https://phab.mercurial-scm.org/D8876
Pulkit Goyal
mergeresult: introduce filemap() which yields filename based mapping

We wanted to remove `actions` as this was leaking how we store things internally
and was direct access to one of the member. This introduces filemap() which
yields a map of `filename` -> `action, args, msg`.

`mergeresult.actions` has been deleted as it's no longer required.

Differential Revision: https://phab.mercurial-scm.org/D8888
Pulkit Goyal
merge: drop commitinfo argument to applyupdates (API)

We now pass the mergeresult object and hence there is no need to have a separate
commitinfo argument as the required info is present in mergeresult object.

Differential Revision: https://phab.mercurial-scm.org/D8904
Pulkit Goyal
mergeresult: add sort argument to getactions() method

This will be used in next patch.

Differential Revision: https://phab.mercurial-scm.org/D8878
Pulkit Goyal
mergeresult: implement a len() function and use it

In next patch we will start yielding from `getactions()` instead of building and
returning a list. Hence we can no longer rely on that for getting us a length.

Differential Revision: https://phab.mercurial-scm.org/D8880
Pulkit Goyal
merge: pass mergeresult obj in _forgetremoved() (API)

Instead of returning a dict of actions and then updating it, let's pass the
object directly and update it there.

This makes `updateactions()` on mergeresult unused and this patch removes that.

After this patch, we have couple of methods left on mergeresult class which
still exposes the internal dict based action storage.

Differential Revision: https://phab.mercurial-scm.org/D8889