Commit Graph

28607 Commits

Author SHA1 Message Date
Adrian Buehlmann
0262d50094 util: fix doc for datestr()
timezone parameter was removed with f88c82e9a297
2016-04-08 22:15:06 +02:00
Florent Gallaire
478ac5c37a date: reallow negative timestamp, fix for Windows buggy gmtime() (issue2513)
DVCS are very useful to store various texts (as legislation) written before
Unix epoch. Fri, 13 Dec 1901 is a nice gain over Thu, 01 Jan 1970.
Revert 856a0e92d107 and b47a679b4e83, fix b2228cbaa635. Add tests.
2016-04-08 14:11:03 +02:00
timeless
a863e51d9a tests: use /usr/bin/env python for test-status-inprocess.py
everyone else uses it, and the next commit will add a rule for it
2016-04-06 19:08:04 +00:00
Augie Fackler
e02a696ec8 run-tests: fix broken regular expression
The regular expression in use passed tests because the test repo only
has single-digit changesets present. When I tried to use this for real
today, it broke, because the regular expression would only match a
single digit.

https://xkcd.com/1171/, or something like that.
2016-04-06 22:26:47 -04:00
Pierre-Yves David
375f437d35 test: don't rely on __del__ in test-devel-warnings.t
Whatever the future of __del__ in Mercurial is, that devel-warning test is not
about testing the automatic transaction rollback and we should explicitly call
release.

This change make this tests pass with pypy, as pypy try less hard to call
__del__ at program exit.
2016-04-05 12:19:45 -07:00
Martijn Pieters
b0b9bca0ca dispatch: split out warning message generation to separate function
Allow for patching warning message generation, or for patching out the ui.log /
ui.warn behaviour (but still generate the warning message).
2016-04-05 20:01:23 +01:00
timeless
bc7ecb0989 check-code: reject import Queue, suggest util.queue class for py3 compat 2016-04-06 20:08:18 +00:00
timeless
85b96c6915 scmutil: use util.queue/util.empty for py3 compat 2016-04-06 20:07:51 +00:00
timeless
9bbc2a69f1 pycompat: add empty and queue to handle py3 divergence
While the pycompat module will actually handle divergence, please
access these properties from the util module:
util.queue = Queue.Queue / queue.Queue
util.empty = Queue.Empty / queue.Empty
2016-04-06 20:00:49 +00:00
Julien Cristau
3e185dc2e6 convert: kill dead code
gitread is unused with the new commandline-based code.
2016-04-04 15:39:13 +02:00
Julien Cristau
dd250f1d5d convert: don't ignore errors from git diff-tree 2016-04-04 15:38:48 +02:00
timeless
372fa02ecc crecord: check for untracked arguments
hg commit tracked untracked -- fails complaining about untracked

prior to this commit,
hg commit -i tracked untracked -- did not fail

This is corrected by calling the refactored localrepo.checkcommitpatterns
2016-04-06 18:19:36 +00:00
timeless
ab5c7033f1 localrepo: drop force check from checkcommitpatterns
It was retained to make the code movement clearer
2016-04-06 18:08:38 +00:00
timeless
f2c255b594 localrepo: refactor commit argument check as checkcommitpatterns 2016-04-06 17:52:17 +00:00
timeless
2493adae19 run-tests: handle empty tests 2016-04-05 04:26:20 +00:00
timeless
6f6caafe41 docchecker: try to reject single quotes 2016-01-12 09:30:57 +00:00
timeless
052bc178fc docchecker: report context line at most once 2016-03-03 03:32:44 +00:00
timeless
842ddb5e9d tests: splitting test-gendoc.t into per file tests
Localizers can now run test-gendoc-$LOCALE.t instead of
test-gendoc.t.

After this change, test-gendoc.t only checks whether there is *some*
localization for the expected set of languages and no others.

Whenever a locale i18n/$LOCALE.po is added, someone needs
to add test-gendoc-$LOCALE.t
2016-01-06 20:45:50 +00:00
Yuya Nishihara
72ff3b217f test-hgweb-auth: stop direct symbol import of mercurial.error.Abort 2016-04-05 23:21:17 +09:00
Yuya Nishihara
5986f39b75 test-hgweb-auth: alias ui as uimod 2016-04-05 23:20:04 +09:00
Yuya Nishihara
0df4c27372 test-hg-parseurl: stop direct symbol import of mercurial.hg.parseurl 2016-04-05 23:18:52 +09:00
Yuya Nishihara
a0a844ca84 test-filelog: alias ui as uimod 2016-04-05 23:17:43 +09:00
Yuya Nishihara
0a1eaee3c0 test-duplicateoptions: alias ui as uimod 2016-04-05 23:17:05 +09:00
Yuya Nishihara
0e28ddc9b4 test-filecache: alias ui as uimod 2016-04-05 23:16:16 +09:00
Yuya Nishihara
34393c8a2f test-filecache: sort import lines 2016-04-05 23:15:49 +09:00
Yuya Nishihara
10370f09a1 test-ctxmanager: stop direct symbol import of mercurial.util 2016-04-05 23:13:52 +09:00
Yuya Nishihara
b6fd0db11c test-batching: stop direct symbol import of mercurial modules
Silences future errors reported by import-checker.py.
2016-04-05 23:10:13 +09:00
timeless
78639f500c children: use double quotes for arguments
You can't use single quotes in cmd.exe. See f4369d3e818c.
2016-01-06 17:18:18 +00:00
timeless
897045e273 largefiles: use double quotes for arguments
You can't use single quotes in cmd.exe. See f4369d3e818c.
2016-01-12 09:30:39 +00:00
timeless
96d9f89f4f graft: use double quotes for arguments
You can't use single quotes in cmd.exe. See f4369d3e818c.
2016-01-12 09:30:24 +00:00
timeless
80a5c496d9 hghave: add cvsnt
cvsnt is a maintained commercial fork of cvs
https://en.wikipedia.org/wiki/CVSNT

It is possible to build a version of it from sources (github),
it requires libpcre and libltdl (libtool).

We already have a test that relates to cvsnt:
test-convert-cvsnt-mergepoints.t

cvsnt installs: cvs, cvslockd, cvsnt, cvsscript

I think we should definitely have a check for cvsnt because it makes
the version checks for cvs make a lot more sense.

When I use the version I built, cvs --version says:

"""
Concurrent Versions System (CVSNT) 2.5.05 (Gan) Build 3744 (Suite) (client/server)

CVSNT 2.5.05 (Apr  4 2016) Copyright (c) 2008 March Hare Software Ltd.
see http://www.march-hare.com/cvspro


CVS Copyright (c) 1989-2001 Brian Berliner, david d `zoo' zuhn,

Jeff Polk, and other authors
CVSNT Copyright (c) 1999-2008 Tony Hoyle and others
see http://www.cvsnt.org

Commercial support and training provided by March Hare Software Ltd.
see http://www.march-hare.com/cvspro

CVSNT may be copied only under the terms of the GNU General Public License v2,
a copy of which can be found with the CVS distribution.

The CVSNT Application API is licensed under the terms of the
GNU Library (or Lesser) General Public License.

Specify the --help option for further information about CVS
"""
2016-04-04 06:27:12 +00:00
Kostia Balytskyi
379ba461ec commands: allow debugobsolete to delete arbitrary obsmarkers
Sample usage is:
  '$ hg debugobsolete --delete 0 5'

This is a debug feature that will help people working on evolution and
obsolescense.
2016-04-01 15:12:50 -07:00
Kostia Balytskyi
1a905d2d03 commands: disallow 'hg debugobsolete --index --rev <smth>'
A bug in the original --index implementation. The goal of --index is to allow
unique obsmarker identification that would be consistent between invocations
of this command in the unchanged repo. Further goal is to use this index to
delete arbitrary obsmarkers. So calling --index together with --rev would
cause obsmarker indices to be different than just calling --index. This is
not desired and current pattern for getting the index of an interesting
obsmarker is: `$ hg debugobsolete --index | grep <interesting hash>`.
It would clearly be better if we could somehow compute a hash of an obsmarker
and use it to identify the one we want to delete, but it seems a bit too
heavy for our current goals, so we can do this later if we want.
2016-04-01 15:20:31 -07:00
Jun Wu
ff951c0c87 mercurial: add editorconfig
Editorconfig (http://editorconfig.org/) is a file format helping define coding
styles like spaces, tabs etc. It supports a wide range of editors. Some well-
known projects like ruby and zsh are using it already.

This patch adds a simple .editorconfig, making it clear we use 8-char tabs in
C code, 4-char spaces in Python code, and we don't keep trailing spaces.
2016-04-05 18:10:33 +01:00
Matt Fowles
be27b58285 parsers: fix istat macro to work with single line if statement 2016-04-05 10:43:43 -04:00
Maciej Fijalkowski
2e11b650af pypy: fix setdiscovery test
This test relies on the exact details of random.sample given the
seed. Things work a bit differently under pypy, make the test less
specific.
2016-04-05 14:44:18 +03:00
Jun Wu
e2b3016869 chg: wrap line at 80 chars
This is a style fix. I was using tabstop=4 for some early patches, although
I realized we use tabstop=8 later but these early style issues remains. Let's
fix them.
2016-04-05 17:43:02 +01:00
Jun Wu
7aec0cb63d chg: replace abortmsg showing errno with abortmsgerrno
Since we have abortmsgerrno now, use it to show human friendly error messages
across platforms.
2016-04-05 15:16:01 +01:00
Jun Wu
0a8e7312da chg: add util function abortmsgerrno to print error with errno
It's common to abortmsg with the errno information. Let's make a utility
function for it.
2016-04-05 17:25:39 +01:00
Jun Wu
24134cf0dd chg: use color in debug/error messages conditionally
Before this patch, chg always uses color in its debugmsg and abortmsg and
there is no way to turn it off.

This patch adds a global flag to control whether chg should use color or
not and only enables it when stderr is a tty and HGPLAIN is not set.
2016-04-05 14:48:09 +01:00
Pierre-Yves David
0c17a400d6 revset: force ascending order for baseset initialized from a set
It is possible to initialize a baseset directly from a set object. However, in
this case the iteration order was inherited from the set. Set have undefined
iteration order (especially cpython and pypy will have different one) so we
should not rely on it anywhere.

Therefor we declare the baseset "ascending" to enforce a consistent iteration
order. The sorting is done lazily by the baseset class and should have no
performance impact when it does not matter.

This makes test-revset.t pass with pypy.
2016-04-04 17:45:54 -07:00
Pierre-Yves David
d25fcd8b52 revset: stabilize repr of baseset initialized with a set
Cpython and pypy have different way to build and order set, so the result of
list(myset) is different. We work around this by using the sorted version of the
data when displaying a list.

This get pypy closer to pass test-revset.t.
2016-04-04 17:45:15 -07:00
Martijn Pieters
bc2e641437 dispatch: factor out command failure handling into a function
Moving the warning generation to a function allows for wrapping and
alternative error handling.
2016-04-04 17:27:37 +01:00
Maciej Fijalkowski
a294e6bdcf pypy: fix overeager pattern matching on mpatchError
Pypy have difference in error reporting.
2016-04-05 10:59:46 +03:00
timeless
4fca2b2f02 mpatch: unify mpatchError (issue5182)
The pure version was mpatch was throwing struct.error or ValueError
for errors, whereas the C version was throwing an "mpatch.mpatchError".

Introducing an mpatch.mpatchError into pure and using it consistently
is fairly easy, but the actual form for it is mercurial.mpatch.mpatchError,
so with this commit, we change the C implementation to match the naming
convention too.
2016-03-31 02:05:28 +00:00
timeless
52801a4e4b check-code: reject sed ... \\n
This would have caught cfe13eb3c333 (fixed by 34113b609b05)
if repcomment didn't make the content of the perl code
opaque to the check.
2016-03-30 22:01:47 +00:00
Pierre-Yves David
4ceff995cf hideablerevs: expand docstring to warn about possible traps
Sean Farley just wasted multiple hours trying to figure out why his code was
crashing. We update the docstring to make the constraint clearer.
2016-04-02 15:56:47 -07:00
Yuya Nishihara
bd8b8c2e65 hghave: replace relative import of docutils.core 2016-04-03 19:47:29 +09:00
Yuya Nishihara
9f89f6c82a tests: make tinyproxy.py not import sys.argv by name 2016-04-03 20:12:59 +09:00
Yuya Nishihara
a8eec6094d tests: alias ui as uimod in test-walkrepo 2016-04-03 20:13:42 +09:00