Commit Graph

1339 Commits

Author SHA1 Message Date
Augie Fackler
7471f2bb40 dockerlib: fix initcontainer for boot2docker users
This allows me to build rpm packages using boot2docker on my Mac. It's
probably a very fragile hack, but it seems to work well enough for now
that I felt it was worth sharing.
2015-05-06 14:36:17 -04:00
Augie Fackler
53739e0ce5 dockerlib: extract initcontainer() method
This helps contain all the logic around creating containers.
2015-05-06 10:45:51 -04:00
Augie Fackler
563404e413 dockerlib: start extracting common functions for setting up docker
I'm about to start interacting with docker for Debian packaging too,
so it's time to centralize this so that any bugfixes I figure out
apply to both codepaths.
2015-05-06 10:45:07 -04:00
Pierre-Yves David
77c097ded9 revset: narrow the subset using smartset operation in roots()
We were manually creating a base with explicit subset testing. We should let
smartset magic happen and optimise that logic if needed.

benchmark show some massive speedup when "parents set" is huge and "subset" is
small.

revset: 42:68 and roots(42:tip)
0) wall 0.011322 comb 0.010000 user 0.010000 sys 0.000000 (best of 161)
1) wall 0.002282 comb 0.010000 user 0.010000 sys 0.000000 (best of 1082)

Minor speedup in simple case (were fullreposet helps)

revset: roots(0::tip)
0) wall 0.095688 comb 0.100000 user 0.100000 sys 0.000000 (best of 85)
1) wall 0.084448 comb 0.080000 user 0.080000 sys 0.000000 (best of 95)

revset: roots((0:tip)::)
0) wall 0.146752 comb 0.140000 user 0.140000 sys 0.000000 (best of 58)
1) wall 0.143538 comb 0.140000 user 0.140000 sys 0.000000 (best of 59)

And small overhead then the "parents set" is fairly complicated (transforming it
into a revset once and for all appears to be faster).

revset: roots((tip~100::) - (tip~100::tip))
0) wall 0.004652 comb 0.010000 user 0.010000 sys 0.000000 (best of 544)
1) wall 0.004878 comb 0.010000 user 0.010000 sys 0.000000 (best of 479)

revset: roots((0::) - (0::tip))
0) wall 0.146587 comb 0.150000 user 0.150000 sys 0.000000 (best of 53)
1) wall 0.157192 comb 0.160000 user 0.160000 sys 0.000000 (best of 53)

revset: first(roots((0::) - (0::tip)))
0) wall 0.152924 comb 0.150000 user 0.150000 sys 0.000000 (best of 57)
1) wall 0.153192 comb 0.160000 user 0.160000 sys 0.000000 (best of 55)
2014-10-11 01:17:40 -07:00
Pascal Quantin
ad2d500d14 win32: remove cacert.pem file from Inno Setup installer
Duplicate the modification done in 38f1dfe18752 for wix installer
so that CA certificates loading works fine with Python 2.7.9+.
2015-04-23 21:23:13 +02:00
Yuya Nishihara
6093d4a115 wix: remove cacert.pem from Windows distribution
It should not be included in the Windows installers because it prevents
loading CA certificates from the system store on Python 2.7.9, implemented
by b572b9736ab0. The msi packages bundles Python 2.7.9, so cacert.pem is no
longer necessary.

Backed out changeset 7c9264a028c0
2015-04-23 22:44:46 +09:00
FUJIWARA Katsunori
a87fdf93f3 check-code: check os.path.join(*, '') not working correctly with Python 2.7.9
Since Python 2.7.9, "os.path.join(path, '')" doesn't append "os.sep"
for UNC path (see issue4557 for detail).
2015-04-22 23:38:55 +09:00
Mads Kiilerich
8561ae6b39 rpms: create missing builds dir if it doesn't exist 2015-04-14 23:51:02 -04:00
Mads Kiilerich
ea7df88985 rpms: for packages with their own python, put it in /opt/python-hg
This is more compliant with the FHS and Fedora packaging guidelines.
2015-04-14 23:44:03 -04:00
Pierre-Yves David
812e82cf4f check-commit: be more picky about detection of wrong bug tag
The check-commit script search for "bug" withing bracket and ask people to use
(issueXXXX) instead. The test was too wide and matching any "(+b+u+g"sequence.
2015-04-12 14:54:53 -04:00
Matt Harbison
6a81772054 import-checker: force 'fcntl', 'grp', 'pwd', and 'termios' to stdlib modules
These are Unix only, and caused these additional warnings on Windows if they
aren't hardcoded as stdlib:

  mercurial/posix.py mixed imports
     stdlib:    errno, getpass, os, socket, stat, sys, tempfile
     relative:  grp, pwd, unicodedata
  mercurial/posix.py mixed imports
     stdlib:    re
     relative:  fcntl
  mercurial/posix.py mixed imports
     stdlib:    array
     relative:  termios

Additionally, this was missing on Windows:

  mercurial/crecord.py mixed imports
     stdlib:    fcntl, termios
     relative:  curses


https://docs.python.org/2/library/fcntl.html
https://docs.python.org/2/library/grp.html
https://docs.python.org/2/library/pwd.html
https://docs.python.org/2/library/termios.html
2015-04-08 22:31:50 -04:00
Matt Harbison
8fffff85bf import-checker: allow *.pyd based stdlib modules
These are Windows dlls, and eliminate the following import check diffs that are
not on Unix:

  mercurial/changegroup.py mixed imports
     stdlib:    os, struct, tempfile, zlib
     relative:  bz2
  mercurial/encoding.py mixed imports
     stdlib:    locale, os
     relative:  unicodedata
2015-04-08 22:23:51 -04:00
Siddharth Agarwal
6a367ef5be perf: make measuring foldmap perf work again
Rev 54727f222a91 split the foldmap into two, but I forgot to update perf for
the changes.
2015-04-02 19:13:50 -07:00
Andrew Shadura
506304a170 hgk: display committer name when set by hg-git 2015-04-03 22:44:25 +02:00
Andrew Shadura
d79f0dfc20 hgk: use switch instead of a less efficient if/elseif/if 2015-03-29 19:15:04 +02:00
Andrew Shadura
a5a999d5cb hgk: set distinct fill and outline colour for non-public and obsolete changesets 2015-03-29 19:12:08 +02:00
Andrew Shadura
e8540303c1 hgk: show secret changesets differently (shape and label) 2015-03-29 18:44:53 +02:00
Andrew Shadura
ff15132c27 hgk: remove no longer needed debug-rev-parse command 2015-03-28 21:33:47 +01:00
Andrew Shadura
48d9f0deb1 hgk: remove no longer needed debug-config command 2015-03-28 21:24:57 +01:00
Andrew Shadura
d0e9f81098 hgk: display obsolete changesets in darkgrey 2015-03-28 20:05:01 +01:00
Andrew Shadura
c509289c81 hgk: pass --hidden switch to hg subprocesses when needed 2015-03-28 19:36:21 +01:00
Matt Mackall
526b5a1fd1 import-checker: rotatecycle is actually the canonical cycle key
So refactor to drop cyclekey().
2015-03-28 00:08:26 -05:00
Matt Mackall
99e8245cd5 import-checker: make search algorithm non-recursive breadth-first
Breadth-first allows finding the shortest cycle including the starting
module. This lets us terminate our search early when we've discovered
shorter paths already. This gives a tremendous speed-up to the
cycle-finding portion of the test, dropping total runtime from 39s to
3s.
2015-03-27 23:52:23 -05:00
Matt Mackall
aa337c67fe import-checker: drop set() from cyclekey() 2015-03-27 19:27:19 -05:00
Matt Mackall
1f89d532b3 import-checker: drop duplicate element from cycle
This will allow optimizing cyclekey creation
2015-03-27 19:25:40 -05:00
Matt Mackall
407d8470d0 import-checker: fix rotatecycle
It was duplicating the last element sometimes.
2015-03-27 18:50:39 -05:00
Laurent Charignon
76fa3c9194 check-code: in C code, prevent space before closing parenthesis 2015-03-24 12:52:53 -07:00
Pierre-Yves David
b9dce14212 contrib: remove the now useless lock-checker.py extension
This feature is in core now, and we do not keep backward compability for
contrib.
2015-03-10 21:25:11 -07:00
Matt Harbison
4849cf877e check-code: enforce the usage of 'seq.py' instead of 'seq' 2015-03-17 21:48:34 -04:00
Matt Mackall
bbeea83192 perf: add methods for timing changeset file list reading 2015-03-18 12:03:44 -05:00
Jordi Gutiérrez Hermoso
8eb132f5ea style: kill ersatz if-else ternary operators
Although Python supports `X = Y if COND else Z`, this was only
introduced in Python 2.5. Since we have to support Python 2.4, it was
a very common thing to write instead `X = COND and Y or Z`, which is a
bit obscure at a glance. It requires some intricate knowledge of
Python to understand how to parse these one-liners.

We change instead all of these one-liners to 4-liners. This was
executed with the following perlism:

    find -name "*.py" -exec perl -pi -e 's,(\s*)([\.\w]+) = \(?(\S+)\s+and\s+(\S*)\)?\s+or\s+(\S*)$,$1if $3:\n$1    $2 = $4\n$1else:\n$1    $2 = $5,' {} \;

I tweaked the following cases from the automatic Perl output:

    prev = (parents and parents[0]) or nullid
    port = (use_ssl and 443 or 80)
    cwd = (pats and repo.getcwd()) or ''
    rename = fctx and webutil.renamelink(fctx) or []
    ctx = fctx and fctx or ctx
    self.base = (mapfile and os.path.dirname(mapfile)) or ''

I also added some newlines wherever they seemd appropriate for readability

There are probably a few ersatz ternary operators still in the code
somewhere, lurking away from the power of a simple regex.
2015-03-13 17:00:06 -04:00
Matt Mackall
37e98d0538 check-code: allow disabling msys path check 2015-03-05 13:21:57 -06:00
Jesus Cea
60d6ae885a copyright: update to 2015
Many files and translations have an outdated copyright date.
Change that to the correct "2005-2015" dates.
2015-03-02 14:52:04 +01:00
Eric Sumner
13daa0c8fd check-commit: check capitalization in summary lines
At the moment, check-commit will complain about the topic being capitalized,
but not the summary that comes after it.  This diff corrects that deficiency.
2015-02-05 14:09:08 -08:00
Mads Kiilerich
031d0b9afc osx: patch .pax.gz files in pkg bundles so they extract as root (issue4081)
The packages has to be installed by root but they would be installed
insecurely, owned by the uid of the unprivileged user that made the package.
The local user with that uid could thus write to /usr/local/bin/hg .

bdist_mpkg calls out to pax to create the package, but pax do apparently not
have the power to control what it is writing.

Instead, patch the pax files and set their uid fields to 0 before they are
wrapped in a dmg.
2015-01-23 06:28:28 +01:00
FUJIWARA Katsunori
0ef76b45c5 check-code.py: avoid warning against "reverting subrepo ..." lines
Before this patch, "reverting subrepo subrepo/path" lines in *.t test
files require "(glob)", because such lines are recognized as
"reverting path/to/managed/file" by "check-code.py".

On the other hand, "(glob)" for such "reverting ..." line is
recognized as useless by "runt-tests.py", because subrepo paths shown
in such lines are always normalized by "util.pconvert". And this
causes "no result code from test" warning.

As a preparation for discarding "(glob)" from such lines in subsequent
patch, this patch avoids warning against them, by adding negative
lookahead assertion "(?!subrepo )" to the regexp.
2015-01-22 00:10:26 +09:00
FUJIWARA Katsunori
6fd4318051 hg.bat: return exit code explicitly for indirect invocation
When "hg.bat" is invoked via interactive shell "cmd.exe" on Windows,
it can store own exit code into ERRORLEVEL correctly, regardless of
explicit "exit" statement in it: "cmd.exe" seems to hold ERRORLEVEL
updated by the last command in the batch file (= "python hg", in
"hg.bat" case).

On the other hand, "hg.bat" is invoked indirectly via
"subprocess.Popen" (e.g. shell alias, hooks, hgclient and so on), the
parent process always receives exit code 0 from spawned "hg.bat":
batch files on Windows seem not to be really spawned like as shell
scripts on UNIX, but to be executed in the "cmd.exe" process.

This patch returns exit code explicitly for indirect invocation.

"/b" should be specified for "exit" to prevent "cmd.exe" from being
terminated when "hg.bat" is invoked interactively from it.
2015-01-22 00:07:06 +09:00
Mads Kiilerich
509ce58a92 osx: update "Read Me" "Important Information" text in the package installer
Nothing fancy here, just making the text less specific and less wrong by not
mentioning OS X version and Python versions and wrong URLs.
2015-01-21 05:01:01 +01:00
Mads Kiilerich
e8c3de8b41 docker: support Fedora 21 2014-11-02 02:36:47 +01:00
Mads Kiilerich
a678d2511e rpm: make Python 2.7.9 the default Python to include in rpms for EL 5
Use the new and more TLS support in Python 2.7.9.
2015-01-16 04:26:40 +01:00
Mads Kiilerich
bb43dcc3a8 contrib: make Python 2.7.9 the default in Makefile.python
We should utilize (and test) the big API changes and new TLS functionality in
Python 2.7.9 whenever possible.
2015-01-16 04:26:25 +01:00
Angel Ezquerra
6e49f7def8 localrepo: remove all external users of localrepo.sopener
This change touches every module in which repository.sopener was being used, and
changes it for the equivalent repository.svfs.

It should now be possible to remove localrepo.sopener.
2015-01-11 00:25:54 +01:00
Augie Fackler
d7a053040f Makefile.python: try curl if wget fails
Macs ship with curl and not wget, so this is a nice little tweak for
folks testing on OS X.
2015-01-13 14:15:08 -05:00
Matt Mackall
465be7563f perf: add a configurable sleep on startup
This is intended to counteract power management by giving a consistent
idle period before test runs.
2015-01-10 21:13:10 -06:00
Mike Edgar
3171ae0735 synthrepo: new filenames must not also be new directories, and vice-versa
When generating many new files into a set of many possible new directories,
there is the possibility that the same path is chosen as both file and
directory. How likely this is depends on the size of the dictionary used,
the generated directory structure and the number of generated files.
2014-12-12 17:42:14 +00:00
Sean Farley
dc331facee debugnamecomplete: rename from debuglabelcomplete
Now that we have decided on the use of 'name' instead of 'label' we rename this
function accordingly.

The old method 'debuglabelcomplete' has been left as a deprecated command so
that current scripts don't break.
2014-10-17 13:41:29 -07:00
Matt Harbison
3c47e94de7 commit: propagate --addremove to subrepos if -S is specified (issue3759)
The recursive addremove operation occurs completely before the first subrepo is
committed.  Only hg subrepos support the addremove operation at the moment- svn
and git subrepos will warn and abort the commit.
2014-11-24 22:27:49 -05:00
Matt Harbison
9e4d7cc2d3 scmutil: pass a matcher to scmutil.addremove() instead of a list of patterns
This will make it easier to support subrepository operations.
2014-11-09 19:57:02 -05:00
Pierre-Yves David
a2ff033417 perf: add a perfloadmarkers command
It is used to benchmark the obsstore initialization time.
2014-11-20 16:27:55 -08:00
Gregory Szorc
ca2488737b docker: add Docker files for running an Apache mod_wsgi server
I frequently find myself wanting to run hgweb in a production-like
environment, with a real HTTP server and multiple WSGI workers.

This patch introduces a Docker environment for running Mercurial
under Apache + mod_wsgi. With just a few command executions, it is
possible to spin up a Docker container running hgweb.

The container is tailored for Mercurial developers wanting to run
Mercurial from a source checkout. It is **not** meant to be something
suitable for production use.

The container provides a default hgweb environment with an empty
repository that allows pushes. You can thus start a container and push
your favorite repository there for quick testing.

The container is designed to allow customizations. Users can provide
their own hgweb configurations and mount existing directories containing
repositories into the container.

The behavior of the container and how to control things is documented in
the README.rst file.
2014-11-11 20:32:10 -08:00