Commit Graph

31086 Commits

Author SHA1 Message Date
Pierre-Yves David
a1d4a95c88 histedit: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:43 -08:00
Pierre-Yves David
d781ee1c04 eol: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:36 -08:00
Pierre-Yves David
db602f5625 convert: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:25 -08:00
Pierre-Yves David
dfb3fbad15 test-bundle2-remote-changegroup: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:55 -08:00
Pierre-Yves David
5e62e32b2e subrepo: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:47 -08:00
Pierre-Yves David
197ab7aeb0 repair: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:39 -08:00
Pierre-Yves David
98f81e8c4f merge: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:32 -08:00
Pierre-Yves David
de20776881 hg-mod: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:24 -08:00
Pierre-Yves David
d47e9585d6 commands: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:17 -08:00
Pierre-Yves David
80b1f7c309 cmdutil: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:09 -08:00
Pierre-Yves David
b71c55108c localrepo: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2016-08-05 14:29:22 +02:00
Pulkit Goyal
077cba9952 minirst: make encoding.encoding unicodes to pass into encode() and decode() 2017-03-12 07:09:18 +05:30
Pulkit Goyal
bd7d2c3f64 minirst: make regular expressions bytes 2017-03-12 06:59:37 +05:30
Gregory Szorc
ebff74a01c setup: convert setupversion to unicode
Something deep in the bowels of distutils expects "version" passed to
setup() to be a str/unicode. So, convert the type.

This still works on Python 2 because the string is ascii and an
implicit coercion back to str/bytes should work without issue. If
it does cause problems, we can always make the unicode conversion
dependent on running Python 3.

This change makes `python3.5 setup.py install` work.
2017-03-11 17:14:02 -08:00
Mads Kiilerich
6cbae57046 util: add debugstacktrace depth limit
Useful when you don't care about the start of the stack, but only want to see
the last entries.
2015-01-14 01:15:26 +01:00
Mads Kiilerich
97ac40d793 util: strip trailing newline from debugstacktrace message
This makes the function more convenient to use as drop-in replacement for
ui.write & co.
2015-01-16 04:26:40 +01:00
Mads Kiilerich
e5c197b9ce tests: rework util.debugstacktrace tests
Prepare for adding another test.
2015-01-16 04:26:40 +01:00
Mads Kiilerich
30045d0a29 vfs: use repo.vfs.rename 2017-03-11 11:04:14 -08:00
Mads Kiilerich
975c19c195 vfs: use repo.vfs.unlinkpath 2017-03-11 11:02:25 -08:00
Mads Kiilerich
01ac38526d merge: use repo.wvfs.unlinkpath 2015-01-14 01:15:26 +01:00
Mads Kiilerich
a936a7f3a7 vfs: use repo.wvfs.unlinkpath 2015-01-14 01:15:26 +01:00
Augie Fackler
f3d54c952b policy: try and always have a bytes for module policy
debuginstall now runs cleanly in Python 3.
2017-03-08 18:11:41 -05:00
Augie Fackler
afdb0af8d1 init: zstd is already python3-ready, so don't run it through our importer 2017-03-08 18:11:19 -05:00
Augie Fackler
db877f58df config: guard against setconfig specifying unicode values on py3
This was leading to some difficult to trace problems because the
values were set in one place, but then blew up much later in the
program. Exploding violently with an assertion seems reasonable here.
2017-03-03 14:42:56 -05:00
Augie Fackler
5759889c58 dispatch: enforce bytes when converting boolean flags to config items
This fixes --verbose on Python 3.
2017-03-03 14:43:27 -05:00
Augie Fackler
b39dab5e11 py3: add a test that proves %include and missing-extension code works 2017-03-03 13:52:08 -05:00
Augie Fackler
4d06a903c5 extensions: tapdance to get reasonable import error formatting
I'm not thrilled with this, but it seems to work.
2017-03-03 14:08:02 -05:00
Martin von Zweigbergk
ef133769b3 rebase: abort if *any* commit in rebase set is public 2017-03-11 10:35:44 -08:00
Augie Fackler
00b54d28ff merge with stable 2017-03-11 13:53:14 -05:00
Gregory Szorc
97e218b123 httpconnection: rename config to groups
Because that is what it is.
2017-03-09 20:53:14 -08:00
Gregory Szorc
6ef9cb88f5 httpconnection: don't use dict()
Not sure the history here. But we don't do this elsewhere.
2017-03-09 20:51:57 -08:00
Martin von Zweigbergk
09677e4708 formatter: set _first on formatter, not ui
The _first field is used for tracking when to emit a separator between
items. It seems like it's clearly formatter state, not ui state, so
let's move it there.
2017-03-09 15:38:00 -08:00
Martin von Zweigbergk
df689070f8 rebase: unhide original working directory node as well (issue5219)
By including the working directory revision at the start of rebase in
the repo._rebaseset, we make sure it's not hidden when we update back
to it at the end of the rebase.

This feels like abusing the set a bit given its name (_rebaseset), but
I couldn't think of another name that's clearly better.
2017-03-10 23:07:20 -08:00
Martin von Zweigbergk
44ffe12623 rebase: pass in a regular set to _setrebasesetvisibility()
Trivial refactoring to simplify the next patch.
2017-03-10 23:06:31 -08:00
Augie Fackler
5811358454 pycompat: verify sys.argv exists before forwarding it (issue5493)
ISAPI_WSGI doesn't set up sys.argv, so we have to look for the
attribute before assuming it exists.
2017-03-07 13:24:24 -05:00
Augie Fackler
821171d27f Added signature for changeset dcc2d404963a 2017-03-02 20:19:45 -05:00
Augie Fackler
a0e0376310 merge with i18n 2017-03-02 20:07:35 -05:00
Wagner Bruna
c77d653cee i18n-pt_BR: synchronized with 11b8e606c473 2017-03-02 11:08:20 -03:00
FUJIWARA Katsunori
7f697ba8f8 i18n-ja: synchronized with 11b8e606c473 2017-03-01 16:43:22 +09:00
Yuya Nishihara
ee998576d8 worker: flush messages written by child processes before exit
I found some child outputs were lost while testing the previous patch. Since
os._exit() does nothing special, we need to do that explicitly.
2017-02-25 12:48:50 +09:00
Yuya Nishihara
fa0a3203ec worker: add basic test to ensure child processes are managed well
This should catch the bug fixed by "worker: ignore meaningless exit status
indication returned by os.waitpid()."

Before, worker.py was untested since test repositories are relatively small.
2017-02-25 12:33:37 +09:00
eloimorlaas
293313403e record: update help to describe ui.interface
hg help record was not accurate if using another interface than the text one
2017-02-23 11:23:17 -08:00
Rishabh Madan
d0ac5a9dcb ui: replace obsolete default-push with default:pushurl (issue5485)
Default-push has been deprecated in favour of default:pushurl. But "hg clone" still
inserts this in every hgrc file it creates. This patch updates the message by replacing
default-push with default:pushurl and also makes the necessary changes to test files.
2017-02-25 16:57:21 +05:30
FUJIWARA Katsunori
47ba9fae77 worker: ignore meaningless exit status indication returned by os.waitpid()
Before this patch, worker implementation assumes that os.waitpid()
with os.WNOHANG returns '(0, 0)' for still running child process. This
is explicitly specified as below in Python API document.

    os.WNOHANG
        The option for waitpid() to return immediately if no child
        process status is available immediately. The function returns
        (0, 0) in this case.

On the other hand, POSIX specification doesn't define the "stat_loc"
value returned by waitpid() with WNOHANG for such child process.

    http://pubs.opengroup.org/onlinepubs/9699919799/functions/waitpid.html

CPython implementation for os.waitpid() on POSIX doesn't take any care
of this gap, and this may cause unexpected "exit status indication"
even on POSIX conformance platform.

For example, os.waitpid() with os.WNOHANG returns non-zero "exit
status indication" on FreeBSD. This implies os.kill() with own pid or
sys.exit() with non-zero exit code, even if no child process fails.

To ignore meaningless exit status indication returned by os.waitpid(),
this patch skips subsequent steps forcibly, if os.waitpid() returns 0
as pid.

This patch also arranges examination of 'p' value for readability.

FYI, there are some issues below about this behavior reported for
CPython.

    https://bugs.python.org/issue21791
    https://bugs.python.org/issue27808
2017-02-25 01:07:52 +09:00
Siddharth Agarwal
7d1a6f9777 bundle2: fix assertion that 'compression' hasn't been set
`n.lower()` will return `compression`, not `Compression`.
2017-02-13 11:43:12 -08:00
Pierre-Yves David
43b1ef004c wireproto: properly report server Abort during 'getbundle'
Previously Abort raised during 'getbundle' call poorly reported (HTTP-500 for
http, some scary messages for ssh). Abort error have been properly reported for
"push" for a long time, there is not reason to be different for 'getbundle'. We
properly catch such error and report them back the best way available. For
bundle, we issue a valid bundle2 reply (as expected by the client) with an
'error:abort' part. With bundle1 we do as best as we can depending of http or
ssh.
2017-02-10 18:20:58 +01:00
Pierre-Yves David
695fa85daa getbundle: cleanly handle remote abort during getbundle
bundle2 allow the server to report error explicitly. This was initially
implemented for push but there is not reason to not use it for pull too. This
changeset add logic similar to the one in 'unbundle' to the
client side of 'getbundle'. That logic make sure the error is properly reported
as "remote". This will allow the server side of getbundle to send clean "Abort"
message in the next changeset.
2017-02-10 18:17:20 +01:00
Pierre-Yves David
d00dbd00d9 bundle1: fix bundle1-denied reporting for pull over ssh
Changeset a0966f529e1b introduced a config option to have the server deny pull
using bundle1. The original protocol has not really been design to allow that
kind of error reporting so some hack was used. It turned the hack only works on
HTTP and that ssh server hangs forever when this is used. After further
digging, there is no way to report the error in a unified way. Using `ooberror`
freeze ssh and raising 'Abort' makes HTTP return a HTTP-500 without further
details. So with sadness we implement a version that dispatch according to the
protocol used.

Now the error is properly reported, but we still have ungraceful abort after
that. The protocol do not allow anything better to happen using bundle1.
2017-02-10 18:06:08 +01:00
Pierre-Yves David
92aa2c1992 bundle-tests: operate from outside a repository
We are about to add a test for ssh pull/cloning being denied because of bundle1
usage. For this, it is cleaner to not operate from the clone using http. So we
update the test beforehand for clarity. This is more churns that what I'm happy
to see on stable, but the rests of the series is worth it in my opinion.
2017-02-10 18:06:12 +01:00
Pierre-Yves David
5b07cfa3b3 bundle1: display server abort hint during unbundle
The code was printing the abort message but not the hint. This is now fixed.
2017-02-10 17:56:52 +01:00