Commit Graph

20236 Commits

Author SHA1 Message Date
Simon Heimberg
d4711ad797 tests: test-module-imports.t works on windows (with backslash path sep)
Transform the backslashes to slashes on windows, because they are eaten up by
the shell. (Similar as done in test-check-pyflakes.t.)

This test will not produce a traceback on windows anymore. But the test still
fails because the detected mixed imports differ.
2014-01-28 00:33:52 +01:00
Matt Mackall
5f4b3d5487 qimport: allow importing URLs 2014-02-07 17:54:10 -06:00
Lucas Moscovicz
0c945a320b revset: fixed bug where revset returning order was being changed
Some revsets were innecesarily turning the subset into a set before iterating
over it. This led to returning order changing in some cases.
2014-02-07 15:01:33 -08:00
Augie Fackler
8bfe6ea1ed itersubrepos: move to scmutil to break a direct import cycle 2014-02-03 18:36:00 -05:00
Mads Kiilerich
33b57154bd import-checker: handle standard modules with arch in the filename
Installations with module names like
/usr/lib/python2.7/lib-dynload/bz2.x86_64-linux-gnu.so occurs in the wild.

Let's just ignore everything after first '.' when guessing the Python module
name.
2014-02-07 02:59:46 +01:00
Simon Heimberg
5367e8636c tests: use ls instead of find, all files are in the same directory
In this case find has no advantage compared to ls. Descending into directories
is unnecessary, because there are none.
2014-02-03 20:08:58 +01:00
Simon Heimberg
d11bb41a51 commands: hg debuginstall checks missing templates (issue4151)
Missing templates where not reported as a problem, only an empty bracket
were shown as indication of no found template directory:
  $ hg debuginstall
  *...some lines*
  checking templates ()...
  *...some lines*
  no problems detected

Now the problem is reported and extended with some information. The style
of the messages is adapted to the other messages of debuginstall.

When no templates directories exist, it writes:
  $ hg debuginstall
  *...some lines*
  checking templates ()...
   no template directories found
   (templates seem to have been installed incorrectly)
  *...some lines*
  1 problems detected, please check your install!

When the template map is not found, it writes:
  $ hg debuginstall
  *...some lines*
  checking templates (/path/to/mercurial/templates)...
   template 'default' not found
   (templates seem to have been installed incorrectly)
  *...some lines*
  1 problems detected, please check your install!

When the template map is buggy the message is the same as before. The error
message is shown before the line "(templates seem ...)".


No test is added because testing this failure is complicated. It would
require to modify the templates directory of the mercurial installation,
or to monkey patch a function (os.listdir or any from mercurial.templater)
by a test extension.
2014-01-27 11:17:07 +01:00
Mads Kiilerich
2e81b00ce5 contrib/Makefile.python: build local Python from source
This provides an easy way to install new or old Python versions on Unixish
systems. It is mainly intended for testing Mercurial with different Python
versions.

Example:
  $ cd build
  $ make -f ../contrib/Makefile.python python PYTHONVER=2.4 PREFIX=/tmp/p24
  $ /tmp/p24/bin/python -V
  Python 2.4

Tested on Fedora, Debian and Ubuntu with Python versions from 2.4 to 2.7.6.

Most Python versions need some workarounds to compile on Debian-ish systems.
The workarounds do not do any significant harm on Fedora.
2013-02-10 00:11:45 +01:00
Mads Kiilerich
9a66d97397 tests: use small conditional section for tic requirement in test-status-color.t
Better test coverage when curses not is available.
2014-02-05 01:45:59 +01:00
Mads Kiilerich
446ad18e32 import-checker: show stdlib and relative imports separately
Make the output more useful for debugging problems.
2014-02-05 01:43:51 +01:00
Mads Kiilerich
3341cf857f tests: improved test coverage for HTTP authentication and 401 responses
Dump the access log to verify that the client gets the 401s it deserves and
handles them correctly. This establishes a baseline for Basic authentication
protocol.
2014-02-05 01:41:36 +01:00
Mads Kiilerich
59b97fe104 tests: ignore http tests that are known wontfix failures on python 2.4
As mentioned on http://bz.selenic.com/show_bug.cgi?id=2739#c17 , babf177f9036
left test-http.t failing on Python < 2.4.3. That has not been noticed because
most 2.4 testing has been done with a patched 2.4.2.

This makes sure that the tests only are run for Python >= 2.4.3. That makes it
possible to verify that everything else works with Python 2.4.
2014-02-05 01:37:37 +01:00
Mads Kiilerich
5651d48005 import-checker: fix names of dynamically loaded modules
The import checker found standard library modules such as
lib-dynload/zlibmodule.so but saw that as a 'zlibmodule' module, not as the
'zlib' module.

Debian ships Python with most modules built-in and this incorrect handling of
dynamic modules did thus not cause problems on that platform.

Fedora ships Python with as many modules as possible loaded dynamically. That
made the import checker tests fail with incorrect classification of the
following modules: array fcntl grp itertools time zlib.

This change makes test-module-imports.t pass on Fedora.
2014-02-05 01:30:33 +01:00
Simon Heimberg
6c82ce566b tests: for consistent output flush between writing sterr and stdout
Because stdout and stderr are buffered, the order of the output is other way
around on some systems.
2014-01-28 02:23:48 +01:00
Mads Kiilerich
a2af430785 discovery: cleanup of variable names and comments 2014-02-06 02:17:48 +01:00
Mads Kiilerich
2e26bbb4c8 localrepo: give a sigh of relief when getting lock after waiting for it
A message like this was sometimes shown when pushing:
  remote: waiting for lock on repository foo held by 'mercurial:20858'
That could scare users, making them wonder whether the push actually succeeded.

To mitigate that fear, issue an additional "warning" such as:
  got lock after 2 seconds

The return value from lock.lock.lock() was unused - instead we return the
delay.

This also adds the first test coverage for waiting for locks.
2014-02-06 01:55:09 +01:00
Sean Farley
6aefcf4449 convert: add tagmap option
Tests have been updated.
2014-01-22 15:43:21 -06:00
Sean Farley
a624daee33 convert: add tagmap logic
Previously, there was no way to rewrite tags on the fly while converting. Now,
we add similar logic to branchmap to provide a way to map old tags to new tags.

Currently, this is not enabled since there is not yet a command-line option.
2014-01-22 15:40:17 -06:00
Sean Farley
53fd264a21 convert: avoid updating tags when there is nothing new
Previously, when converting from a mercurial repo there would be an extraneous
commit at the end of the convert process that would rewrite tags. Now, we check
if there are any new tags before doing this rewriting.
2014-01-22 15:31:24 -06:00
Sean Farley
3c22b1037d convert: compare tags from all heads instead of just one
Previously, the hg sink for puttags would just use one head for getting the old
tags which would sometimes lead to tags disappearing. Now, we iterate over all
heads and merge the results.
2014-01-22 17:38:05 -06:00
Sean Farley
e7a8a8092c convert: add closemap option
Tests have been updated.
2014-01-21 11:35:17 -06:00
Sean Farley
5507a20bc9 convert: add parseclosemap method
This is a copy of the parsesplicemap method and will serve as a way to specify
which changesets to close while converting.
2014-01-21 11:20:14 -06:00
Sean Farley
4b88fb7766 convert: add mapname parameter to checkrevformat
Upcoming patches will add new map files so we change the calling sequence of
checkrevformat so that error messages will let the user know which file has the
wrong rev format.
2014-01-21 11:34:55 -06:00
Sean Farley
dac1309a34 convert: replace old sha1s in the description
This is a simple find-and-replace strategy for matching anything in the
old description of a converted commit and, if that matched sha1 exists
in the mapping, replacing it with the new sha1.

In particular, this is helpful for descriptions that contain tags with
messages such as, "Added tag 1.0 for commit abcde1234567" which will now
be automatically converted.

Tests have been updated accordingly.
2013-04-18 10:05:50 -05:00
Durham Goode
41c61c62a7 template: fix shortest(node) function in pure mercurial
Pure mercurial (i.e. without c extensions) does not support partialmatch() on
the revlog index, so we must fall back to use revlog._partialmatch() to handle
that case for us. The tests caught this.

We don't use revlog._partialmatch() for the normal case because it performs a
very expensive index iteration when the string being tested fails to find a
unique result via index.partialmatch(). It does this in order to filter
out hidden revs in hopes of the string being unique amongst non-hidden revs.
For the shortest(node) case, we'd prefer performance over worrying about
hidden revs.
2014-02-05 20:22:28 -08:00
Durham Goode
fe9653ca83 template: add pad function for padding output
Adds a pad template function with the following signature:

pad(text, width, fillchar=' ', right=False)

This uses the standard python ljust and rjust functions to produce a string
that is at least a certain width. This is useful for aligning variable length
strings in log output (like user names or shortest(node) output).
2014-01-17 00:16:48 -08:00
Durham Goode
156d6da226 template: add shortest(node) template function
Adds a '{shortest(node)}' template function that results in the shortest hex node
that uniquely identifies the changeset at that time. The minimum length can be
specified as an optional second argument and defaults to 4.

This is useful for producing prettier log output, like so:

@  durham  shortestnode
|  77cf    template: add pad function for padding output
|
o  durham
|  b183    template: add shortestnode keyword
|
o  pierre-yves @
|  6545    backout: add a message after backout that need manual commit
|
| o  durham   manifestcache
|/   93f0    manifest cache
|
| o  durham   catperf
| |  c765    cat: increase perf when catting single files
| |
| o  durham
|/   9c53    changectx: increase perf of walk function
|
2014-01-17 00:10:37 -08:00
Matt Mackall
b81a4c8743 merge with stable 2014-02-05 18:09:07 -06:00
Matt Mackall
fd6c6f9614 hgweb: hack around mimetypes encoding thinko (issue4160)
A correct patch for this has existed in Python's BTS for 3 years
(http://bugs.python.org/issue9291), so waiting for it to be fixed
upstream is probably not a viable strategy. Instead, we add this
horrible hack to workaround the issue in existing copies of Python
2.4-2.7.
2014-02-05 17:23:35 -06:00
Siddharth Agarwal
228773d706 hg: note that islocal only accepts paths pointing to repos
hg.islocal doesn't work for paths pointing to non-repos, such as patch files.
2014-02-03 14:36:20 -08:00
Siddharth Agarwal
cfe3861321 hg.openpath: use url.islocal to tell if the path is local (issue3624)
Previously we used hg.islocal, which doesn't work for paths pointing to
non-repos, such as patch files.
2014-02-03 14:53:44 -08:00
Siddharth Agarwal
22a22b291a util.url: add an 'islocal' method
This returns True if the URL represents a path that can be opened locally,
without needing to go through the entire URL open mechanism.
2014-02-03 14:47:41 -08:00
Matt Mackall
4a9059c01f Added signature for changeset 235171a1c71c 2014-02-01 15:20:49 -06:00
Matt Mackall
681a024aa8 merge with i18n 2014-02-01 14:53:52 -06:00
Pierre-Yves David
b563457396 rebase: do not crash in panic when cwd disapear in the process (issue4121)
Before this patch rebase crashed badly when it happend. (not abort, crash).

Fix courtesy of Matt Mackall.
2014-01-31 15:13:15 -08:00
Pierre-Yves David
0d013e32a2 record: use absolute path instead of os.chdir
Record was changing the current directory to `repo.root` in order to be able to
feed `command.commit` file name relative to this `repo.root`. This is a bit
overkill and prevent an incoming fix to rebase. This would also break
multi-threaded usage.

Instead we just feed `command.commit` with absolute path name. works as well as
before but without chdir.
2014-01-31 14:52:53 -08:00
Wagner Bruna
7d02010045 i18n-pt_BR: synchronized with 14badd276955 2014-01-31 15:25:31 -02:00
FUJIWARA Katsunori
1faeeaaaaa i18n-ja: change translation to fix test-gendoc.t failure with old docutils
Before this patch, "ja.po" translation causes test-gendoc.t failure
with old docutils: It fails with docutils 0.7, but not with 0.11.
2014-01-31 16:27:26 +09:00
Simon Heimberg
0663ca30c6 i18n-de: update many fuzzy entries and translate some simple ones
I mainly did the simple cases, like removing ".. note::", changing single
quotes to double quotes and adapting underlining.
Unhelpful msgstr in fuzzy entries are removed. (They were suggestions by the
program msgmerge.)
2014-01-30 23:34:18 +01:00
Angel Ezquerra
83f28887f2 help: improve description of phases.checksubrepos setting
The existing description was a bit hard to understand.
2014-01-29 15:16:36 +01:00
Pierre-Yves David
6265090dee clone: do not turn hidden changeset public on publishing clone (issue3935)
Before this changeset local clone of a repo with hidden changeset would include
then in the clone (why not) and turn them public (plain wrong). This happened
because the copy clone publish by dropping the phaseroot file entirely making
everything in the repo public (and therefore immune to obsolescence marker).

This changeset takes the simplest fix, we deny the copy clone in the case of hidden
changeset falling back to pull clone that will exclude them from the clone and
therefore not turning them public.

A smarter version of copy clone could be done, but I prefer to go for the
simplest solution first.
2014-01-30 11:52:38 -08:00
lstewart
7eb5e89201 convert: use branchmap to change default branch in destination (issue3469)
The fix for issue2653 broke the ability to map the default branch of a source
repository to a non-default named branch in the destination repository.  Leave
the default behaviour as is, but allow the branch name "None" to be used to map
to a non-default named branch in the destination repository.
2014-01-28 14:00:23 +11:00
Julien Cristau
e78105c48a dispatch: take --hidden from individual commands into account
The command server would otherwise ignore that option, since the repo
object is only created once.
2014-01-27 10:57:20 +01:00
FUJIWARA Katsunori
870ab22a06 doc: fix mistake about matching against directories in "pattern.txt"
This fixes mistake of documentation about matching against directories
in "pattern.txt" introduced by b99923dc748f.

".hgignore" treats specified "glob:" pattern as same as one specified
for "-X" option: it can match against directories, too.

For reference, extra regexp string appended to specified pattern for
each types are listed below: see also "match.match()" and
"match._regex()" for detail.

  ============= ========== ===============
  type          cmdline    -I/-X
  ============= ========== ===============
  glob/relglob  '$'        '(?:/|$)'
  path/relpath  '(?:/|$)'  '(?:/|$)'
  re/relre      (none)     (none)
  ============= ========== ===============

Appending '$' means that the specified pattern should match against
only files.
2014-01-30 15:03:36 +09:00
FUJIWARA Katsunori
0b98e91e90 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
Before this patch, shell alias may be executed by abbreviated command
name unexpectedly, even if abbreviated command name matches also
against the command provided by extension.

For example, "rebate" shell alias is executed by "hg reba", even if
rebase extension (= "rebase" command) is enabled. In this case, "hg
reba" should be aborted because of command name ambiguity.

This patch makes "_checkshellalias()" invoke "cmdutil.findcmd()"
always with "strict=True" (default value).

If abbreviated command name matches against only one shell alias even
after loading extensions, such shell alias will be executed via
"_parse()".

This patch doesn't remove "_checkshellalias()" invocation itself,
because it may prevent shell alias from loading extensions uselessly.
2014-01-29 23:47:54 +09:00
Matt Mackall
c738b36ce1 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155) 2014-01-30 13:56:56 -06:00
FUJIWARA Katsunori
26f147d151 i18n-ja: change phrasing for "or" 2014-01-30 17:09:13 +09:00
FUJIWARA Katsunori
14b2d2b8ec i18n-ja: fix some quoting problems for space character usage 2014-01-29 22:14:41 +09:00
FUJIWARA Katsunori
6441520dfe i18n-ja: synchronized with 3ff21233db0b 2014-01-29 21:38:10 +09:00
Lucas Moscovicz
3d0344901f revset: added intersection to baseset class
Added the method __and__ to the baseset class to be able to intersect with
other objects in a more efficient way.
2014-01-24 16:57:44 -08:00