Commit Graph

1639 Commits

Author SHA1 Message Date
Sean Farley
ac64faac8c builddeb: create source archive for ubuntu 2016-04-16 17:06:11 -07:00
Sean Farley
86966707e3 builddeb: ignore vcs and build results
This one is a no-brainer. Previously, if you tried to build a deb on ubuntu, it
would try to diff files in the .hg store. These flags prevent that.
2016-04-15 15:44:00 -07:00
Sean Farley
2aa8466d25 builddeb: copy over .gz and .dsc files
We were forgetting to copy over the signature (if it exists) and the zipped
diff, so let's do that.
2016-04-15 14:28:26 -07:00
Sean Farley
738ce5394f builddeb: ignore errors about find not finding files
The debuild command may output less files than we explicitly list so let's not
error out if none exist.
2016-04-15 14:27:42 -07:00
Sean Farley
cf4a77c8c0 builddeb: use the os codename instead of 'unstable'
This fixes a lintian error (and indeed, launchpad rejects it) by using the
distribution's codename (e.g. xenial, trusty, etc).
2016-04-16 12:42:53 -07:00
Sean Farley
71e02dfaad builddeb: use sed -i
Notice that there is no space after '-i'. This makes it work on both GNU and
BSD versions of sed.
2016-04-16 12:33:21 -07:00
Sean Farley
aa0d445553 dockerdeb: redirect 'cd' in export command to /dev/null
This had the unfortunate side effect of causing the environment to have a
newline due to the fact that some 'cd' outputs the result of the directory
change. So, let's just redirect the meaningless output.
2016-04-17 10:36:40 -07:00
Sean Farley
24f7624e5e debian: add missing netbase dependency
Apparently, some machines don't have this service (launchpad builders are one
such example). This adds the correct dependency for test-serve.t.
2016-04-17 10:39:17 -07:00
Sean Farley
11b650fc97 debian: add missing zip/unzip dependencies 2016-04-16 14:24:25 -07:00
Sean Farley
278c6cac50 debian: add missing python-docutils dependency 2016-04-15 13:53:23 -07:00
Sean Farley
10771f89cc debian: add missing python-all-dev dependency 2016-04-15 13:46:16 -07:00
Jun Wu
837ef17e43 chg: forward SIGWINCH to worker
Before this patch, if the user uses chg and ncurses interface, resizing the
terminal window will mess up its content.

This patch fixes the issue by forwarding SIGWINCH to the worker process.
2016-04-10 01:28:52 +01:00
timeless
9af2e630f0 import-checker: parse python code from .t files 2016-04-12 21:43:56 +00:00
timeless
103d337d89 import-checker: track filenames for SyntaxErrors 2016-04-13 16:34:59 +00:00
timeless
37896a9aaf import-checker: track SyntaxErrors
We don't really need to report SyntaxErrors, since in theory
docchecker or a test will catch them, but they happen, and
we can't just have the code crash, so for now, we're reporting
them.
2016-04-13 16:36:19 +00:00
timeless
36d6fb58ef import-checker: refactor source reading
This will allow .t files to generate multiple sources.
It will also allow .py doctests to generate additional sources.
2016-04-11 22:34:04 +00:00
timeless
93c46657f1 check-code: reject import urllib 2016-04-07 00:34:07 +00:00
Jun Wu
63d1d02bc9 chg: server exited with code 0 without being connectable is an error
Before this patch, if the server started by chg has exited with code 0 without
creating a connectable unix domain socket at the specified address, chg will
exit with code 0, which is not the correct behavior. It can happen, for
example, CHGHG is set to /bin/true.

This patch addresses the issue by checking the exit code of the server and
printing a new error message if the server exited normally but cannot be
reached.
2016-04-10 22:00:34 +01:00
Jun Wu
fda8134cfd chg: use fsetcloexec instead of closing lockfd manually
Since we have the fsetcloexec utility function, use it instead of closing
lockfd manually.
2016-04-11 00:18:27 +01:00
Jun Wu
f8e2eeaa6b chg: extract the logic of setting FD_CLOEXEC to a utility function
Setting FD_CLOEXEC is useful for other fds such like lockfd and sockdirfd,
move the logic from hgc_open to util.
2016-04-11 00:17:17 +01:00
Jun Wu
b8937b0692 chg: add fchdirx as a utility function
As part of the series to support long socket paths, we need to use fchdir and
check its result in several places. Make it a utility function.
2016-04-10 03:14:32 +01:00
Jun Wu
bfa0407ff7 chg: check lockfd at freecmdserveropts
We check for sockdirfd at freecmdserveropts but not lockfd, which is a bit
strange to people new to the code. Add a comment and an assert to make it
clear that lockfd should be closed earlier.
2016-04-10 22:58:11 +01:00
Jun Wu
625c1b8ab3 chg: add sockdirfd to cmdserveropts
As part of the series to support long socket paths, we need to add the fd of
the directory to the cmdserveropts structure so we can use basenames instead
of full paths for sockname, redirectsockname, and lockfile.
2016-04-10 23:56:00 +01:00
Jun Wu
29846cf694 chg: fix spelling in the error message about error waiting for cmdserver
This is a trivial spelling and grammar fix.
2016-04-10 21:56:05 +01:00
timeless
edef054d1b test-commandserver: handle cStringIO.StringIO/io.StringIO divergence 2016-04-06 20:34:34 +00:00
timeless
bc7ecb0989 check-code: reject import Queue, suggest util.queue class for py3 compat 2016-04-06 20:08:18 +00: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
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
Jun Wu
9c2bea1fcf chg: make connect debug message less repetitive
Before this patch, "connect to" debug message is printed repeatedly because
a previous patch changed how the chg client decides the server is ready to be
connected.

This patch revises the places we print connect debug messages so they are less
repetitive without losing useful information.
2016-04-04 02:36:05 +01:00
Maciej Fijalkowski
eb8f037251 tests: fix builtin module test on pypy
On pypy datetime and cProfile are modules written in Python, not in C.
For the purpose of this test, just list them explicitely as builtins,
which silences warnings about them being imported before stdlib modules.
2016-03-30 21:54:26 +02:00
timeless
cb70588e15 py3: handle iter/iterkeys+iteritems python3 divergence in import-checker 2016-03-30 08:15:37 +00:00
timeless
14b03acded py3: use print_function in import-checker 2016-03-30 04:55:16 +00:00
timeless
9580d303e6 py3: use absolute_import in import-checker 2016-03-30 04:50:19 +00:00
timeless
250ff767cf py24: remove check-code py24 notation
We require python2.6+
2016-03-30 07:24:51 +00:00
Anton Shestakov
c68e50dfa3 rpms: add hgext3rd to mercurial.spec
Otherwise build process fails with somethings like this:


RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/lib64/python2.7/site-packages/hgext3rd/__init__.py
   /usr/lib64/python2.7/site-packages/hgext3rd/__init__.pyc
   /usr/lib64/python2.7/site-packages/hgext3rd/__init__.pyo
make: *** [docker-fedora20] Error 1
2016-03-23 11:53:11 +08:00
Jun Wu
7779785093 chg: allows default hg path to be overridden
Before this patch, chg will fall back to "hg" if neither CHGHG nor HG are set.
This may have trouble if the "hg" in PATH is not compatible with chg, which
can happen, for example, an old hg is installed in a virtualenv.

Since it's very hard to do a quick hg version check from chg, after discussion
in IRC with smf and marmoute, the quickest solution is to build a package with
a hardcoded absolute hg path in chg. This patch makes it possible by adding a
C macro HGPATH.
2016-03-20 15:43:20 -07:00
Jun Wu
fa8cfab3d2 chg: define PRINTF_FORMAT_ for non gnu C compiler
Before this patch, if __GNUC__ is not defined, PRINTF_FORMAT_ will not be
defined and will cause compilation error.

This patch solves the issue by making sure PRINTF_FORMAT_ is defined. It
allows chg to be compiled with tcc (http://bellard.org/tcc/) by:

  tcc -o chg *.c
2016-03-20 15:25:25 -07:00
Augie Fackler
98d0d11b3c check-code: also ban strcat
We're not using it now, so it's easy to ban.
2016-03-19 20:49:02 -04:00
Augie Fackler
c34901f108 check-code: prevent use of strcpy 2016-03-19 20:18:38 -04:00
Gregory Szorc
671d581fbd tests: try to import modules with Python 3
All of mercurial.* is now using absolute_import. Most of
mercurial.* is able to ast parse with Python 3. The next big
hurdle is being able to import modules using Python 3.

This patch adds testing of hgext.* and mercurial.* module imports
in Python 3. As the new test output shows, most modules can't
import under Python 3. However, many of the failures are due
to a common problem in a highly imported module (e.g. the bytes vs
str issue in node.py).
2016-03-12 14:05:23 -08:00
Gregory Szorc
06a84c707a tests: perform an ast parse with Python 3
Previously, test-check-py3-compat.t parsed Python files with Python 2
and looked for known patterns that are incompatible with Python 3.

Now that we have a mechanism for invoking Python 3 interpreters from
tests, we can expand check-py3-compat.py and its corresponding .t
test to perform an additional AST parse using Python 3.

As the test output shows, we identify a number of new parse failures
on Python 3. There are some redundant warnings for missing parentheses
for the print function. Given the recent influx of patches around
fixing these, the redundancy shouldn't last for too long.
2016-03-18 16:15:12 -07:00
Pulkit Goyal
4650b402b2 contrib: revsetbenchmarks use absolute_import and print_function 2016-03-16 04:35:03 +05:30
Pulkit Goyal
ec9a9da094 contrib: synthrepo use absolute_import 2016-03-16 04:23:58 +05:30
Pulkit Goyal
5cf3296f5c contrib: python-hook-examples use absolute_import 2016-03-16 04:13:28 +05:30
Pulkit Goyal
17d5faaa79 contrib: make perf.py use absolute_import 2016-03-16 04:12:16 +05:30
Jun Wu
9a62943b10 chg: do not redirect stdout to /dev/null
Redirecting stdout to /dev/null has unwanted side effects, namely ui.write
will stop working. This patch removes the redirection code and helps chg to
pass test-bad-extension.t.
2016-03-14 15:05:25 +00:00
Jun Wu
f94ba7eabd chg: downgrade "failed to read channel" from abortmsg to debugmsg
If the server has an uncaught exception, it will exit without being able to
write the channel information. In this case, the client is likely to complain
about "failed to read channel", which looks inconsistent with original hg.
This patch silences the error message and makes uncaught exception behavior
more like original hg. It will help chg to pass test-fileset.t.
2016-03-14 23:28:14 +00:00