Commit Graph

1305 Commits

Author SHA1 Message Date
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
Pierre-Yves David
53a1a60278 transaction: pass a vfs map to the transaction
The goal is to allow access to file outside ofthe store directory from the
transaction. The obvious target are the `bookmarks` file. But we can envision
usage for cache too.

We keep passing a main opener explicitly because a lot of code rely on this
default opener. The main opener (operating on store) is using an empty key ''.
2014-10-17 20:49:39 -07:00
Mike Edgar
536f09de36 synthrepo: when adding files, ensure new path is not a directory 2014-10-20 14:20:43 -04:00
Mike Edgar
b7b380cf6e synthrepo: synthesized dates must be positive, fit in 32-bit signed ints 2014-10-20 13:59:13 -04:00
Pascal Quantin
dc313786c5 win32: remove Mercurial.ini file from Inno Setup installer (issue4435) 2014-11-04 21:54:27 +01:00
Pascal Quantin
ece10c0d99 win32: fix win32 installers generation
61f674b4b466 introduced a typo preventing a proper generation of the
installers. Also remove ConcatenateFiles() function as it is no more
required.
2014-11-04 21:35:49 +01:00
Pierre-Yves David
1154bfe337 perf: use a formatter for output
We use a `formatter` object in the perf extensions. This allow the use of
formatted output like json. To avoid adding logic to create a formatter and pass
it around to the timer function in every command, we add a `gettimer` function
in charge of returning a `timer` function as simple as before but embedding an
appropriate formatter.

This new `gettimer` function also return the formatter as it needs to be
explicitly closed at the end of the command.

example output:


  $ hg --config ui.formatjson=True perfvolatilesets visible obsolete
  [
   {
    "comb": 0.02,
    "count": 126,
    "sys": 0.0,
    "title": "obsolete",
    "user": 0.02,
    "wall": 0.0199398994446
   },
   {
    "comb": 0.02,
    "count": 117,
    "sys": 0.0,
    "title": "visible",
    "user": 0.02,
    "wall": 0.0250301361084
   }
  ]
2014-11-04 10:40:06 +00:00
Mads Kiilerich
79172c85c8 config: move mergetools configuration from contrib to default configuration
The merge tool configuration is an essential part of a good initial user
experience. 'make osx' installers and direct 'make' installation did not have
merge tool configuration. Now they have.

Note: The installer fixes for windows have been done blindly and might require
additional changes.
2014-10-19 03:22:23 +02:00
Mads Kiilerich
ef7acfd93a contrib: buildrpm checking of md5 checksums of downloaded Python and Docutils 2014-10-18 21:48:38 +02:00
Mads Kiilerich
262c34851d contrib: update build defaults to latest Python and docutils versions
Use Python 2.7.8 and Docutils 0.12 for Makefile.python and buildrpm (CentOS 5
rpms).
2014-11-02 16:39:02 +01:00
Mads Kiilerich
523c87c1fe spelling: fixes from proofreading of spell checker issues 2014-04-17 22:47:38 +02:00
Matt Mackall
1dfcf35d21 test-revert.t: fix wc check-code false positive 2014-11-03 11:06:51 -06:00
Mads Kiilerich
e41b8f78e4 buildrpm: fix use of invalid $PLATFORM in mercurial.repo 2014-11-01 20:00:00 +01:00
Jordi Gutiérrez Hermoso
d3b97d5baf doc: change 'revision or range' to 'revision or revset'
The phrase "revision or range" comes from a pre-revset era. Since the
documentation for ranges now is under the revset docs, and as a
helpful hint nudging users towards revsets, I think it's better to say
"revision or revset"
2014-10-24 13:50:00 -04:00
Mads Kiilerich
b7b83cd1eb docker: use official centos5 image
I guess it didn't exist when centos5 support was introduced.
2014-10-16 17:44:37 +02:00
Mads Kiilerich
79c175d696 docker: add centos7 target for CentOS / Red Hat 7 support 2014-10-16 17:44:14 +02:00
Yuya Nishihara
be8d33d42a test-commandserver: add connector for unix domain socket server
The next patch will introduce --cmdserver unix.
2014-09-27 19:18:20 +09:00
Yuya Nishihara
ec858daa54 test-commandserver: allow check() to make connection in different way
The next patch will add connector for 'unix' mode server.
2014-09-27 23:14:26 +09:00
Yuya Nishihara
3f66387706 test-commandserver: remove unused repopath argument from check()
Instead of repopath, check() will receive connect() function as argument.
It will allow to connect to server of different mode.
2014-09-27 22:39:01 +09:00
FUJIWARA Katsunori
e916da76f7 import-checker: check modules for pure Python build correctly
Before this patch, "import-checker.py" just replaces "/" in specified
filenames by ".". This makes modules for pure Python build belong to
"mercurial.pure" package, and prevents "import-checker.py" from
correctly checking about cyclic dependency in them.

This patch discards "pure" component from fully qualified name of such
modules.

To avoid discarding "pure" from the module name of standard libraries
unexpectedly, this patch allows "dotted_name_of_path" to discard
"pure" only from Mercurial specific modules, which are specified via
command line arguments.
2014-10-17 02:07:05 +09:00
FUJIWARA Katsunori
3bd1cfb5ca import-checker: treat "from mercurial import XXXX" style correctly
Before this patch, "import-checker.py" assumes that the name of
Mercurial module recognized by "imported_modules" doesn't have package
part: for example, "util".

This is reason why "import-checker.py" always builds fully qualified
module name up relatively, if the given module doesn't belong to
standard Python library.

But in fact, modules imported in "from mercurial import XXXX" style
already have fully qualified name: for example, "mercurial.util"
module imported by "mercurial.parsers" is treated as
"mercurial.mercurial.util" because of building module name up
relatively.

This prevents "import-checker.py" from correctly checking about cyclic
dependency in them.

This patch avoids building module name up relatively, also if module
name starts with "mercurial.", to treat modules imported in "from
mercurial import XXXX" style correctly.
2014-10-17 02:07:05 +09:00
Siddharth Agarwal
6a0b47b797 perf: add a way to measure the perf of constructing the foldmap
Constructing the foldmap is a necessary part of operations like 'hg status' on
OS X. This command allows us to measure the perf of constructing it.
2014-10-03 19:58:26 -07:00
Mike Edgar
b638017ffe contrib/synthrepo: walk a repo's directory structure during analysis
Augments the analyze command to additionally walk the repo's current
directory structure (or of any directory tree), counting how many files
appear in which paths. This data is saved in the repo model to be used
by synthesize, for creating an initial commit with many files.

This change is aimed at developing, testing and measuring scaling
improvements when importing/converting a large repository to mercurial.
2014-09-12 22:07:23 -04:00
Mike Edgar
d923fc04a6 contrib/synthrepo: generate initial repo contents using directory shape model
Augments the synthesize command to use an additional parameter to the analyzed
repo model: the number of files in each directory at a given snapshot. Before
synthesizing history, an arbitrary number of files will be generated in a
distribution matching the analyzed directory structure.

Intended for developing, testing and measuring scaling improvements when
importing/converting a large repository to Mercurial.
2014-09-12 22:04:29 -04:00
Andrew Shadura
e7903979d4 hgk: define bookmark colour explicitly, as Tk 8.6 has changed their meaning 2014-09-28 13:27:40 +02:00
Yuya Nishihara
03d7086901 test-commandserver: make runcommand message bolder
It seems ' runcommand' is difficult to distinguish from command output.
'*** runcommand' is slightly better.
2014-09-28 17:21:38 +09:00
Yuya Nishihara
095547c625 test-commandserver: remove redundant banner output
Since test output was inlined, "testing <func>" message should no longer
be necessary.
2014-09-28 16:59:30 +09:00
Yuya Nishihara
1d33f9598f test-commandserver: split helper functions to new hgclient module
This prepares for porting test-commandserver.py to .t test.

Though command-server test needs many Python codes, .t test will be more
readable than .py test thanks to inlined output.
2014-09-28 13:31:16 +09:00
Pierre-Yves David
e1494119f1 revsetbenchmark: add a rebase-related revset to the benchmark list 2014-09-23 17:12:27 -07:00
Pierre-Yves David
a74e4ee649 revsetbenchmark: allow comments ('#' prefix) in the revset input 2014-09-23 17:09:19 -07:00
Pierre-Yves David
250b8754d7 revsetbenchmark: make it clear that revsets may be read from stdin 2014-09-23 17:08:49 -07:00
Mike Edgar
919b082a9b contrib/synthrepo: pass options to ctx.diff as kwargs, not a dict 2014-09-12 21:38:52 -04:00
Mike Edgar
6431a1d631 contrib/synthrepo: only generate 2 parents if model contains merges
If `hg analyze` is run on a revision set which contains no merges, then
`hg synthesize` will raise IndexError trying to select from p2distance,
which will be empty.
2014-09-12 17:43:37 -04:00
Mads Kiilerich
d45e42f05e contrib: add OS X p4merge to mergetools.hgrc 2014-08-27 16:39:44 +02:00
Gregory Szorc
34df9cb908 revsetbenchmarks: add an additional roots() benchmark
The existing roots(x - y) revset only considered the most recent 100
revisions. This was a good start. But expanding it to the full history
of the repository can dramatically increase execution time and thus
constitutes a useful benchmark.
2014-09-07 11:33:22 -07:00