Kyle Lippincott <spectral@google.com> [Mon, 08 Jul 2019 13:06:46 -0700] rev 42572
crecord: make KEY_ENTER usable in tests (by not updating UI)
Differential Revision: https://phab.mercurial-scm.org/D6620
Kyle Lippincott <spectral@google.com> [Mon, 08 Jul 2019 12:38:37 -0700] rev 42571
crecord: fix if -> elif when handling key presses
This shouldn't actually change any behavior, I only noticed it since I started
using KEY_UP in tests, and it was complaining when it got down to the ^L
handler that initscr hadn't been called yet.
Differential Revision: https://phab.mercurial-scm.org/D6619
Kyle Lippincott <spectral@google.com> [Mon, 08 Jul 2019 12:17:06 -0700] rev 42570
crecord: add "x" alias for space, remove test-only "TOGGLE" alias
Differential Revision: https://phab.mercurial-scm.org/D6618
Kyle Lippincott <spectral@google.com> [Mon, 08 Jul 2019 12:15:37 -0700] rev 42569
crecord: stop using test-only "X" as alternative for "c"
Differential Revision: https://phab.mercurial-scm.org/D6617
Taapas Agrawal <taapas2897@gmail.com> [Sat, 06 Jul 2019 22:19:36 +0530] rev 42568
graft: moved abortgraft and readgraft to cmdutil
This patch moves `abortgraft` and `readgraft` to
`cmdutil`. Various callers are updated accordingly.
This is done because these serve as ulitlity functions
for command `graft` and so that new functions regarding
graft can be built from them.
Differential Revision: https://phab.mercurial-scm.org/D6608
Augie Fackler <augie@google.com> [Thu, 20 Jun 2019 14:33:42 -0400] rev 42567
cleanup: use named constants for second arg to .seek()
Differential Revision: https://phab.mercurial-scm.org/D6556
Kyle Lippincott <spectral@google.com> [Thu, 20 Jun 2019 14:45:52 -0700] rev 42566
patch: use a short, fixed-size message for last line of prompt (
issue6158)
See
issue6158 and the previous commit for examples of what might go wrong if we
have some combinations of readline version and terminal and need to wrap the
line.
Briefly: readline may not display the beginning of the last line of the prompt,
or it may print over it with the end of the prompt, making it difficult for
users to know what's going on.
Differential Revision: https://phab.mercurial-scm.org/D6563
Kyle Lippincott <spectral@google.com> [Thu, 20 Jun 2019 11:40:47 -0700] rev 42565
filemerge: make last line of prompts <40 english chars (
issue6158)
I've chosen <40 as the target so that other languages that may have a 2x blowup
in character count can still have a chance to fit into an 80 column screen.
Previously, we would show a prompt like:
```
keep (l)ocal [dest], take (o)ther [source], or leave (u)nresolved for some/potentially/really/long/path?
```
On at least some systems, if readline was in use then the last line of the
prompt would be wrapped strangely if it couldn't fit entirely on one line. This
strange wrapping may be just a carriage return without a line feed, overwriting
the beginning of the line; example (100 columns wide, 65 character filename, and
yes there's 10 spaces on the end, I assume this is to handle the user inputting
longest word we provide as an option, "unresolved"):
```
ng/dir/name/that/does/not/work/well/with/readline/file.txt? ave (u)nresolved for some/lon
```
In some cases it may partially wrap onto the next line, but still be missing
earlier parts in the line, such as below (60 columns wide, 65 character
filename):
```
rev], or leave (u)nresolved for some/long/dir/name/that/do
s/not/work/well/with/readline/file.txt?
```
With this fix, this looks like this on a 60 column screen:
```
tool vim_with_markers (for pattern some/long/dir/name/that/d
oes/not/work/well/with/readline/file.txt) can't handle binar
y
tool meld can't handle binary
tool vim_with_markers can't handle binary
tool internal:merge3 can't handle binary
tool merge can't handle binary
no tool found to merge some/long/dir/name/that/does/not/work
/well/with/readline/file.txt
file 'some/long/dir/name/that/does/not/work/well/with/readli
ne/file.txt' needs to be resolved.
You can keep (l)ocal [working copy], take (o)ther [merge rev
], or leave (u)nresolved.
What do you want to do?
```
Differential Revision: https://phab.mercurial-scm.org/D6562
Augie Fackler <raf@durin42.com> [Tue, 09 Jul 2019 10:07:35 -0400] rev 42564
Added signature for changeset
97ada9b8d51b
Augie Fackler <raf@durin42.com> [Tue, 09 Jul 2019 10:07:33 -0400] rev 42563
Added tag 5.0.2 for changeset
97ada9b8d51b
Augie Fackler <augie@google.com> [Mon, 08 Jul 2019 13:12:20 -0400] rev 42562
posix: always seek to EOF when opening a file in append mode
Python 3 already does this, so skip it there.
Consider the program:
#include <stdio.h>
int main() {
FILE *f = fopen("narf", "w");
fprintf(f, "narf\n");
fclose(f);
f = fopen("narf", "a");
printf("%ld\n", ftell(f));
fprintf(f, "troz\n");
printf("%ld\n", ftell(f));
return 0;
}
on macOS, FreeBSD, and Linux with glibc, this program prints
5
10
but on musl libc (Alpine Linux and probably others) this prints
0
10
By my reading of
https://pubs.opengroup.org/onlinepubs/
009695399/functions/fopen.html
this is technically correct, specifically:
> Opening a file with append mode (a as the first character in the
> mode argument) shall cause all subsequent writes to the file to be
> forced to the then current end-of-file, regardless of intervening
> calls to fseek().
in other words, the file position doesn't really matter in append-mode
files, and we can't depend on it being at all meaningful unless we
perform a seek() before tell() after open(..., 'a'). Experimentally
after a .write() we can do a .tell() and it'll always be reasonable,
but I'm unclear from reading the specification if that's a smart thing
to rely on. This matches what we do on Windows and what Python 3 does
for free, so let's just be consistent. Thanks to Yuya for the idea.
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sat, 06 Jul 2019 19:55:29 -0400] rev 42561
tweakdefaults: make hg resolve require --re-merge flag to re-merge
Pulkit suggested it in https://phab.mercurial-scm.org/D4379, and a
discussion with Octobus people reminded me that people still use the
error-prone default behavior of `hg resolve`.
Differential Revision: https://phab.mercurial-scm.org/D6610
Navaneeth Suresh <navaneeths1998@gmail.com> [Thu, 04 Jul 2019 21:29:28 +0530] rev 42560
unshelve: rename _dounshelve() to dounshelve()
This is a follow-up patch to
3de4f17f4824.
Differential Revision: https://phab.mercurial-scm.org/D6605
Raphaël Gomès <rgomes@octobus.net> [Mon, 01 Jul 2019 15:07:31 +0200] rev 42559
rust: remove Deref in favor of explicit methods
Differential Revision: https://phab.mercurial-scm.org/D6593
Raphaël Gomès <rgomes@octobus.net> [Mon, 01 Jul 2019 10:53:36 +0200] rev 42558
rust: simplify overly complicated expression
Differential Revision: https://phab.mercurial-scm.org/D6592
Raphaël Gomès <rgomes@octobus.net> [Mon, 01 Jul 2019 10:50:18 +0200] rev 42557
rust: run rfmt on all hg-core/hg-cpython code
Differential Revision: https://phab.mercurial-scm.org/D6591
Anton Shestakov <av6@dwimlabs.net> [Wed, 03 Jul 2019 10:06:39 +0800] rev 42556
move: --force flag forcibly moves, not copies
Anton Shestakov <av6@dwimlabs.net> [Wed, 03 Jul 2019 10:01:51 +0800] rev 42555
copy: correct synopsis by making SOURCE a required argument
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 02 Jul 2019 10:53:29 +0200] rev 42554
debugrevlog: fix average size computation for empty data (
issue6167)
If the file has no full snapshot (eg: was always empty), `hg debugrevlog` would
fails when trying to compute their average size.
Martin von Zweigbergk <martinvonz@google.com> [Mon, 01 Jul 2019 16:25:51 -0700] rev 42553
changelog: fix handling of empty copy entries in changeset
Before this patch, when an empty value was found in the changeset, we
would get a ValueError, which would result in None being returned for
addedfiles/removedfiles and p1copies/p2copies. That made
278dcb24e535
(copies: write empty entries in changeset when also writing to
filelog, 2019-04-23) ineffective at helping the read path not look for
copies in the filelogs.
Differential Revision: https://phab.mercurial-scm.org/D6595
Sushil khanchi <sushilkhanchi97@gmail.com> [Sun, 30 Jun 2019 17:52:57 +0530] rev 42552
relnotes: document the new --force-close-branch flag
Differential Revision: https://phab.mercurial-scm.org/D6590
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 11 Jun 2019 20:53:14 +0300] rev 42551
py3: hack around inconsistency of type of name passed to DNSQuestion
I don't like this patch but this is the easiest way I could fix it. There are
some callers which pass name which is bytes, some pass name which is str. I just
encode() that if that's str.
This does makes test-paths.t pass, but I am not confident whether the whole of
zeroconf will work on py3 or not.
Differential Revision: https://phab.mercurial-scm.org/D6511
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 11 Jun 2019 20:48:59 +0300] rev 42550
py3: add r'' prefixes and do ('%d' % int) instead of str(int)
This addresses more failures related to zeroconf on py3.
Differential Revision: https://phab.mercurial-scm.org/D6510
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Feb 2019 12:07:31 -0800] rev 42549
zeroconf: port to Python 3
Since we're using the source transformer on Python 3, calls into
Zeroconf and return values from it are generally bytes.
But various socket functions require str on Python 3.
This commit contains enough changes to coerce test-paths.t into
passing on Python 3. I suspect there are still a handful of bugs
on Python 3. But the tests do pass.
Differential Revision: https://phab.mercurial-scm.org/D5805
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Jun 2019 16:40:36 -0700] rev 42548
copies: return only path from _tracefile() since that's all caller needs
Differential Revision: https://phab.mercurial-scm.org/D6587
Navaneeth Suresh <navaneeths1998@gmail.com> [Sun, 30 Jun 2019 13:04:26 +0530] rev 42547
extensions: add shelve to _builtin
This is a follow-up patch to
3de4f17f4824. This adds `shelve` to
`extensions._builtin` so that the shelve extension is silently
ignored.
Differential Revision: https://phab.mercurial-scm.org/D6589
Yuya Nishihara <yuya@tcha.org> [Sun, 30 Jun 2019 15:10:56 +0900] rev 42546
merge with stable
Matt Harbison <matt_harbison@yahoo.com> [Sat, 29 Jun 2019 23:23:07 -0400] rev 42545
bookmarks: backout the attempt to fix the delete race
This backs out
044045dce23a because it broke a bunch of tests on Windows.
Yuya's theory is that we still rely on in-memory changelog data to be flushed
out of the transaction.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Jun 2019 14:13:00 -0700] rev 42544
automv: access status fields by name, not index
Differential Revision: https://phab.mercurial-scm.org/D6586
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Jun 2019 14:07:09 -0700] rev 42543
automv: use public API for getting copies
Differential Revision: https://phab.mercurial-scm.org/D6585
Sushil khanchi <sushilkhanchi97@gmail.com> [Sat, 18 May 2019 15:44:23 +0530] rev 42542
commit: add --force-close-branch flag to close a non-head changeset
While closing branch from a changeset which is not a branch head
current implementation abort this action in every case but, there
can be the situations where the changeset is not a local head but
could be a remote head. This patch adds the functionality to bypass
the "abort: can only close branch heads" by introducing
--force-close-branch flag.
Test case changes demonstrate the new functionality added.
Differential Revision: https://phab.mercurial-scm.org/D6490
Navaneeth Suresh <navaneeths1998@gmail.com> [Fri, 28 Jun 2019 21:31:34 +0530] rev 42541
shelve: move shelve extension to core
Until now, `shelve` was bootstrapped as an extension. This patch adds
`shelve` on core.
Differential Revision: https://phab.mercurial-scm.org/D6553
Navaneeth Suresh <navaneeths1998@gmail.com> [Fri, 28 Jun 2019 22:57:48 +0530] rev 42540
shelve: remove rebase.clearstatus()
This is a follow-up patch to
c829749e7639. After this, shelve will be
no longer dependent on rebase. This removes rebase.clearstatus() from
shelve.
Differential Revision: https://phab.mercurial-scm.org/D6584
Taapas Agrawal <taapas2897@gmail.com> [Thu, 20 Jun 2019 00:59:16 +0530] rev 42539
shelve: removed redundant merge detection method
Differential Revision: https://phab.mercurial-scm.org/D6547
Raphaël Gomès <rgomes@octobus.net> [Wed, 05 Jun 2019 17:58:34 +0200] rev 42538
rust-dirstate: call new "dirs" rust implementation from Python
This is a simple module attribute replacement, will take precedence over the
Python and C implementations.
Differential Revision: https://phab.mercurial-scm.org/D6395
Raphaël Gomès <rgomes@octobus.net> [Thu, 16 May 2019 18:03:42 +0200] rev 42537
rust-dirstate: add "dirs" rust-cpython binding
There is an obvious performance and memory issue with those bindings on larger
repos as it copies and allocates everything at once, round-trip. Like in the
previous patch series, this is only temporary and will only get better once
we don't have large data structures going to and from Python.
Differential Revision: https://phab.mercurial-scm.org/D6394
Raphaël Gomès <rgomes@octobus.net> [Thu, 16 May 2019 18:03:06 +0200] rev 42536
rust-dirstate: add "dirs" Rust implementation
Following the work done in
d1786c1d34fa and working towards the goal of a
complete Rust implementation of the dirstate, this rewrites the `dirs` class.
There is already a C implementation, which relies heavily on CPython hacks and
protocol violations for performance, so I don't expect this to perform as well
for now, as this is very straight-forward code.
The immediate benefits are new high-level documentation and some unit tests.
Differential Revision: https://phab.mercurial-scm.org/D6393
Taapas Agrawal <taapas2897@gmail.com> [Fri, 21 Jun 2019 00:26:07 +0530] rev 42535
relnotes: added description about statemod._statecheck
Differential Revision: https://phab.mercurial-scm.org/D6557
Taapas Agrawal <taapas2897@gmail.com> [Fri, 28 Jun 2019 03:15:39 +0530] rev 42534
statecheck: shifted defaults to addunfinished()
This shifts the definitions and defaults of `_statecheck()`
class to `addunfinished()` registration method.
Differential Revision: https://phab.mercurial-scm.org/D6583
Taapas Agrawal <taapas2897@gmail.com> [Thu, 20 Jun 2019 11:40:08 +0530] rev 42533
statecheck: added support for cmdutil.afterresolvedstates
This removes `afterresolvedstates` from `cmdutil` and adds
support for it in `_statecheck` class.
A new flag `continueflag` is added to the class to check whether an
operation supports `--continue` option or not.
Tests remain unchanged.
Differential Revision: https://phab.mercurial-scm.org/D6551
Taapas Agrawal <taapas2897@gmail.com> [Sun, 09 Jun 2019 02:12:58 +0530] rev 42532
statecheck: added support for STATES
This removes `STATES` from `state.py` and adds support to
`statecheck` class to handle its features.
`getrepostate()` function is modified accordingly.
This adds a method 'cmdutil.addunfinished()' for appending to
the unfinishedstate list so as to keep 'merge' and 'bisect' at the last.
This also makes two separate message formats for `checkunfinished()` and
`getrepostate()` as there were previously present.
Results of test changed are shown.
Differential Revision: https://phab.mercurial-scm.org/D6503
Taapas Agrawal <taapas2897@gmail.com> [Sun, 09 Jun 2019 01:13:13 +0530] rev 42531
state: moved cmdutil.STATES and utilities to state.py
This commit moves `cmdutil.STATES` and adjoining functions to
`state.py`. The existing users are updated accordingly.
Tests remain unchanged.
Differential Revision: https://phab.mercurial-scm.org/D6502
Taapas Agrawal <taapas2897@gmail.com> [Sun, 09 Jun 2019 00:43:36 +0530] rev 42530
state: created new class statecheck to handle unfinishedstates
For the purpose of handling states for various multistep operations like
`hg graft`, `hg histedit`, `hg bisect` et al a new class called statecheck
is created .This will help in having a unified approach towards these commands
and handle them with ease.
The class takes in 4 basic arguments which include the name of the command, the
name of the state file associated with it , clearable flag , allowcommit flag.
This also also adds the support of`checkunfinished()` and
`clearunfinished()` to the class.
Tests remain unchanged.
Differential Revision: https://phab.mercurial-scm.org/D6501
Taapas Agrawal <taapas2897@gmail.com> [Sat, 08 Jun 2019 23:43:53 +0530] rev 42529
states: moved cmdutil.unfinishedstates to state.py
This moves `cmdutil.unfinishedstates`, `checkunfinished()`,`clearunfinished()`
to `state.py`. the already existing users of this module are updated accordingly.
Test results remain unchanged.
Differential Revision: https://phab.mercurial-scm.org/D6484
Martin von Zweigbergk <martinvonz@google.com> [Mon, 24 Jun 2019 16:01:22 -0700] rev 42528
rebase: fix in-memory rebasing of copy of empty file
Classic Python mistake of unintentionally treating None and empty
string the same.
Differential Revision: https://phab.mercurial-scm.org/D6570
Martin von Zweigbergk <martinvonz@google.com> [Mon, 24 Jun 2019 16:07:59 -0700] rev 42527
tests: demonstrate broken in-memory rebase of copy to empty file
Differential Revision: https://phab.mercurial-scm.org/D6569
Kyle Lippincott <spectral@google.com> [Tue, 25 Jun 2019 14:23:02 -0700] rev 42526
zsh: enable completion support for chg as well
When verifying this change, you may need to clear/rebuild the completion cache;
I did this by deleting the ~/.zcompdump file and then starting a new shell.
Differential Revision: https://phab.mercurial-scm.org/D6574
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Tue, 25 Jun 2019 19:32:08 -0700] rev 42525
py3: make catapult usable from the test runner in py3
Differential Revision: https://phab.mercurial-scm.org/D6577
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Tue, 25 Jun 2019 19:30:24 -0700] rev 42524
py3: use integer division for the value passed to xrange
Differential Revision: https://phab.mercurial-scm.org/D6576
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Tue, 25 Jun 2019 19:28:41 -0700] rev 42523
pycompat: make fewer assumptions about sys.executable
There are many Python "bundlers" which create an archive to run a Python binary
from, and they may not set sys.executable at all - handle that case properly,
especially to run tests.
Differential Revision: https://phab.mercurial-scm.org/D6575
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Thu, 27 Jun 2019 11:39:35 +0200] rev 42522
update: fix spurious unclean status bug shown by previous commit
The crux of the problem is:
- the dirstate is corrupted (the sizes/dates are assigned to the wrong files)
- because when worker.worker is used with a return value (batchget in
merge.py here), the return value when worker.worker effectively parallelizes
is permuted
- this is because worker.worker's partition of input and combination of output
values are not inverses of one another: it split [1,2,3,4,5,6] into
[[1,3,5],[2,4,6]], but combines that into [1,3,5,2,4,6].
Given that worker.worker doesn't call its function argument on contiguous
chunks on the input arguments, sticking with lists means we'd need to
know the relation between the inputs of worker.worker function argument
(for instance, requiring that every input element is mapped to exactly
one output element). It seems better to instead switch return values to
dicts, which can combined reliably with a straighforward restriction.
Differential Revision: https://phab.mercurial-scm.org/D6581
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Thu, 27 Jun 2019 11:09:09 +0200] rev 42521
tests: show bug in update introduced in
87a34c767384
As reported by Martin at https://phab.mercurial-scm.org/D6475.
Differential Revision: https://phab.mercurial-scm.org/D6580
Martin von Zweigbergk <martinvonz@google.com> [Wed, 26 Jun 2019 05:20:02 -0700] rev 42520
copies: document how 'copies' dict instances are reused
We avoid copying these instances as much as we can, so it's not
obvious what's safe to do with them. This patch tries to explain what
is safe and what is not.
Differential Revision: https://phab.mercurial-scm.org/D6578
Martin von Zweigbergk <martinvonz@google.com> [Thu, 20 Jun 2019 10:58:14 -0700] rev 42519
copies: simplify merging of copy dicts on merge commits
After we removed some filtering in
35d674a3d5db (copies: don't filter
out copy targets created on other side of merge commit, 2019-04-18),
we will always include all entries from "copies1", so we can simplify
the code based on that.
Differential Revision: https://phab.mercurial-scm.org/D6561
Martin von Zweigbergk <martinvonz@google.com> [Thu, 20 Jun 2019 10:42:16 -0700] rev 42518
copies: remove a redundant matcher filtering in _changesetforwardcopies()
We filter before pushing items on the queue, so we don't need to
filter after popping.
Differential Revision: https://phab.mercurial-scm.org/D6560
Martin von Zweigbergk <martinvonz@google.com> [Thu, 20 Jun 2019 10:51:23 -0700] rev 42517
copies: delete obsolete comment in _changesetforwardcopies()
IIRC, the comment applied to the filtering we did before
35d674a3d5db
(copies: don't filter out copy targets created on other side of merge
commit, 2019-04-18).
Differential Revision: https://phab.mercurial-scm.org/D6559
Augie Fackler <augie@google.com> [Mon, 24 Jun 2019 14:28:21 -0400] rev 42516
merge with stable
Matt Harbison <matt_harbison@yahoo.com> [Sat, 22 Jun 2019 23:04:52 -0400] rev 42515
help: add a missing blank line to unhide `revlog-compression`
The help was output, but it was elided with "Enabled by default" from the
previous item.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 19 Jun 2019 23:14:10 -0700] rev 42514
copies: avoid reusing the same variable for two different copy dicts
"childcopies" is initally the copies the current changeset to one of
its children and then we reassign it with the copies from the start of
the chain to the child. Let's use different names for these two
things.
Differential Revision: https://phab.mercurial-scm.org/D6564
Martin von Zweigbergk <martinvonz@google.com> [Fri, 21 Jun 2019 09:33:57 -0700] rev 42513
drawdag: don't crash when writing copy info to changesets
When writing copies to the changeset, localrepo.commitctx() will call
ctx.p1copies() and ctx.p2copies(). These crashed on simplecommitctx
because they ended up trying to access the manifest. drawdag doesn't
support copies at all, so we can simply override the methods to return
empty dicts.
Differential Revision: https://phab.mercurial-scm.org/D6565