Commit Graph

1646 Commits

Author SHA1 Message Date
Sean Farley
bf3866fc9f make: turn ubuntu docker into template
This allows us to easily add more ubuntu docker targets (which following
patches will do).

Also, we no longer need the mkdir command.
2016-04-26 23:33:17 -07:00
Kevin Bullock
971fb62b26 osx: create a modern package including manpages
Instead of using bdist_mpkg, we use the modern Apple-provided tools to
build an OS X Installer package directly. This has several advantages:

* Avoids bdist_mpkg which seems to be barely maintained and is hard to
  use.
* Creates a single unified .pkg instead of a .mpkg.
* The package we produce is in the modern, single-file format instead of
  a directory bundle that we have to zip up for download.

In addition, this way of building the package now correctly:

* Installs the manpages, bringing the `make osx`-generated package in
  line with the official Mac packages we publish on the website.
* Installs files with the correct permissions instead of encoding the
  UID of the user who happened to build the package.

Thanks to Augie for updating the test expectations.
2016-04-27 10:20:36 -05:00
Yuya Nishihara
c61ec06302 chg: initialize sockdirfd to -1 instead of AT_FDCWD
As we don't use sockdirfd yet, this is the simplest workaround to compile chg
on old Unices where AT_FDCWD does not exist. Foozy pointed out Mac OS X 10.10
is required for AT_FDCWD as well as xxxat() functions.
2016-04-24 21:35:30 +09:00
Matt Mackall
01fb35972f bdiff: fix latent normalization bug
This bug is hidden by the current bias towards matches at the
beginning of the file. When this bias is tweaked later to address
recursion balancing, the normalization code could cause the next block
to shrink to a negative length, thus creating invalid delta chunks. We
add checks here to disallow that.

This bug requires test cases that are an awkwardly large size for the test
suite, but is very rapidly picked up by the included torture tester.
2016-04-21 21:53:18 -05:00
Sean Farley
68327cd0d7 dockerdeb: pass the rest of the args to the builder script
It seems this was the original intent of the script so this patch passes the
remanining arguments to builddeb.
2016-04-23 12:47:57 -07:00
Sean Farley
b338df1c3a dockerdeb: fix incorrect number of shifts
From the comment, it appears that the original intent was to remove the first
two arguments, so this patch does just that.
2016-04-23 12:47:39 -07:00
Sean Farley
2ae42c9c04 builddeb: add flag for a source-only deb
This is required for building a ppa for ubuntu which following patches will
use.
2016-04-16 13:01:47 -07:00
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