Commit Graph

16368 Commits

Author SHA1 Message Date
Mads Kiilerich
41e384d611 tests: remove race in test-pull-pull-corruption.t
The output from the background process was not always interleaved "correctly"
with output from the foreground process.
2012-04-23 01:39:26 +02:00
Mads Kiilerich
9571ceabc0 tests: fix bashism in test-convert-splicemap.t
This should have been caught by check-code.
2012-04-23 01:39:26 +02:00
Thomas Arendsen Hein
243e5232c0 opener: coding style, use triple quotes for doc string 2012-04-18 15:16:15 +02:00
Adrian Buehlmann
104162e2b1 pure/osutil: use Python's msvcrt module (issue3380)
As proposed by Christophe Gouiran <christophe.gouiran@eurocopter.com>
2012-04-19 17:08:12 +02:00
Idan Kamara
a5b84a16ff commands: add missing wlock to graft 2012-04-19 18:11:48 +03:00
Idan Kamara
62440b9ac3 dirstate: write branch file atomically 2012-04-19 18:11:42 +03:00
Idan Kamara
5db73f60d8 commands: add missing wlock to branch 2012-04-19 17:59:23 +03:00
Idan Kamara
09faf4a623 commands: add missing wlock to backout 2012-04-19 17:59:23 +03:00
FUJIWARA Katsunori
c7ab63f3a6 i18n: show localized messages for commands/extensions in hgweb help top (issue3383)
in hgweb help top page, help topics are localized, but abstracts of
commands and extensions are not, although these are already
translated.

it is because localized messages for them should be explicitly looked
up by original ones.

this patch looks localized messages up for each commands/extensions.
2012-04-19 20:54:56 +09:00
Angel Ezquerra
60d6e7877d revert: show warning when reverting subrepos that do not support revert
The warning is similar to the warning that was shown before hgsubrepo revert
support was added, with the exception that now the subrepo type is shown.

For example, when trying to revert a git subrepo located in "include/mygitsub",
the warning message would be:

include/mygitsub: reverting git subrepos is unsupported
2012-04-19 23:36:42 +02:00
Bryan O'Sullivan
6dd793955c revset: fix O(n**2) behaviour of bisect() (issue3381) 2012-04-18 21:27:35 -07:00
Patrick Mezard
6067403d0d convert/svn: do not try converting empty head revisions (issue3347)
Subversion conversion works by picking trunk and branches heads, computing a
revision graph from them and converting the selected commits. By design we fail
to convert empty revisions so we have to be careful when discovering the
revision graph. In this particular issue, the source svn repository was a
partial mirror made by svnsync. The funny part is svnsync preserves all
revisions including empty ones. Also, we trusted ra.stat(path,
stop).created_rev to give us the latest revision with changes in path history
up to stop. This assumption broke at least when path is '', that is the
repository root, which always returned 'stop' revision despited being empty.

The workaround is to first trust ra.stat() but if the returned revision appear
empty, search the whole path history from stop to r1 until some changes are
found.
2012-04-18 14:04:58 +02:00
Patrick Mezard
b8a30fde3a convert/svn: refactor svn_source.latest() with a nested function
We will call it more than once for reasons detailed later.
2012-04-18 14:04:58 +02:00
Patrick Mezard
d11f49e922 convert/svn: clarify svn_source.latest() stop arg default value
stop=0 could pass for a valid default value at first sight.
2012-04-18 14:04:57 +02:00
Steven Stallion
adee5af180 factotum: rename mount and path configuration entries
The factotum extension used mount and path entries which were too
generic. These have been replaced by mountpoint and executable
(respectively) to match existing conventions.
2012-04-17 21:12:37 -07:00
Matt Mackall
9b8a43a58b Added signature for changeset 51c1bb93bd38 2012-04-18 11:46:23 -05:00
Matt Mackall
f23ed05e2d Makefile: be more careful when cleaning up pure/ components
The recent introduction of pure/__init__.py causes
mercurial/__init__.py to get clobbered by make clean.
2012-04-18 11:45:50 -05:00
Idan Kamara
66000da94d commit: add option to amend the working dir parent
The --amend flag can be used to amend the parent of the working directory
with a new commit that contains the changes in the parent in addition to
those currently reported by "hg status", if there are any. The old commit
is stored in a backup bundle in ".hg/strip-backup"(see "hg help bundle"
and "hg help unbundle" on how to restore it).

Message, user and date are taken from the amended commit unless specified.
When a message isn't specified on the command line, the editor will open
with the message of the amended commit.

It is not possible to amend public changesets (see "hg help phases") or
changesets that have children.

Behind the scenes, first commit the update (if there is one) as a regular
child of the current parent. Then create a new commit on the parent's
parent with the updated contents. Then change the working copy parent
to this new combined changeset. Finally, strip the amended commit and
update commit created in the beginning.

An alternative (cleaner?) approach of doing this is suggested here:
http://selenic.com/pipermail/mercurial-devel/2012-March/038540.html

It is currently not possible to amend merge commits or recursively,
this can be added at a later time.
2012-04-18 01:20:16 +03:00
Steven Stallion
ac3686e8e8 transplant: remove extraneous whitespace 2012-04-16 22:41:03 -07:00
Matt Mackall
6cebf7e4fb journal: use tryread helper to backup files (issue3375) 2012-04-17 11:13:38 -05:00
Matt Mackall
b55cd4a40b opener: introduce tryread helper
This makes it easier to follow the common pattern "read a file or give
an empty string if it's missing".
2012-04-17 11:11:59 -05:00
Angel Ezquerra
d9ec5798ba tests: add test for fileset 'subrepo' keyword 2012-04-17 07:22:44 +02:00
Patrick Mezard
c57d92d67c revset: make matching() work on python 2.4
tuple.index() was apparently added to python 2.6:

  http://bugs.python.org/issue1696444

Also remove a trailing comma to make check-code.py happy.
2012-04-17 10:33:47 +02:00
Thomas Arendsen Hein
69b89489ab revset: use list instead of tuple for compatibility with python before 2.6
'string elements'.split() instead of explicitly typing a list of strings is
used. This is done in other parts of Mercurial code, too.
2012-04-17 15:10:33 +02:00
Matt Mackall
1ca3f6721a merge with stable 2012-04-16 16:50:25 -05:00
Patrick Mezard
4539c8fa89 archive: make it work with svn subrepos (issue3308)
- _svncommand() in files() returns a tuple since 1ca3bbcf0c2a not a string.
- _svncommand() in filedata() returns a tuple not a string.
- "svn list" returns files but also directories.
- "svn list" is not recursive by default.

I have no idea what happens to svn:externals possibly embedded in the svn
subrepository.
2012-04-16 11:48:15 +02:00
Martin Geisler
004ba88f28 largefiles: hide .hglf/ prefix for largefiles in hgweb
This makes the manifest view in hgweb match what you see in the
working copy and what you get when you download an archive in hgweb.
2012-04-15 16:05:57 +02:00
Martin Geisler
b08f38425c hgweb: add hook for remapping repository path into virtual paths
Extensions such as largefiles can use this to remap files so they
appear in the same location as they do in the user's working copy.
2012-04-15 16:05:53 +02:00
Angel Ezquerra
103460f1f9 tests: add tests for matching keyword
This adds a couple of tests for the revset "matching" keyword:

1. Test that the 2nd parameter is optional
2. Test that all the 1st argument can be a revset and that all the supported
fields of the 2nd argument work.
2012-04-15 00:27:31 +02:00
Angel Ezquerra
19cbf3a030 revset: speedup matching() by first matching fields that take less time to
match

This patch sorts the fields that are passed to the matching function so that it
always starts by matching those fields that take less time to match.

Not all fields take the same amount of time to match. I've done several
measurements running the following command:

hg --time log -r "matching(1, field)"

on the mercurial repository, and where 'field' was each one of the fields
accepted by match. In order to avoid the print overhead (which could be
different for different fields, given the different number of matches) I used a
modified version of the matching() function which always returns no matches.

These tests showed that different fields take wildly different amounts of time
to match. Particulary the substate field takes up to 25 seconds to match on my
machine, compared to the 0.3 seconds that takes to match the phase field or the
2 seconds (approx) that takes to match most fields. With this patch, matching
both the phase and the substate of a revision takes the same amount of time as
matching the phase.

The field match order introduced by this patch is as follows:

phase, parents, user, date, branch, summary, files, description, substate

An extra nice thing about this patch is that it makes the match time stable.
2012-04-14 01:41:03 +02:00
Patrick Mezard
bdf6ede885 mq: replace hasattr() with util.safehasattr(), update check-code.py 2012-04-13 15:07:13 +02:00
Angel Ezquerra
2b1f5fd344 revset: speedup matching() by stopping the match early if a field does not match
Rather than getting all the fields that are being matches from every revision
and then comparing them to those of the target revision, compare each field one
by one and stop the match as soon as there is a match failure.

This can greatly reduce the match time when matching multiple fields.
The impact on match time when matching a single field seems negligible
(according to my measurements).
2012-04-13 13:46:49 +02:00
Angel Ezquerra
806c38f88b revset: make matching keyword not match summary when matching for description 2012-04-13 13:35:45 +02:00
Patrick Mezard
ef43384e07 revset: avoid set duplication in roots() 2012-04-08 11:14:56 +02:00
Patrick Mezard
af77d0083f revset: retrieve a bit less parents in roots() 2012-04-08 11:13:06 +02:00
Patrick Mezard
4bfe090298 revset: do not ignore input revisions in roots()
0233b606220f is also partially reverted to use the 'narrow' parameter again and
make less changesets parents lookups.
2012-04-08 11:11:30 +02:00
Matt Mackall
c2b48cba25 merge with crew 2012-04-06 15:17:50 -05:00
Patrick Mezard
20f55f2de4 hghave: remove symlink test made useless by f9442b2a2789 2012-04-04 15:59:56 +02:00
Julien Cristau
a473958b12 tests: disable progress estimate in test-debugbuilddag.t
If the command takes long enough, including 'estimate' in the format
will add some more data to the progress bar output, and make the test
fail.  See e.g.
https://buildd.debian.org/status/fetch.php?pkg=mercurial&arch=kfreebsd-amd64&ver=2.1.2-2&stamp=1333493711
2012-04-04 13:55:11 +02:00
Kevin Bullock
cb270596b4 ui: swallow EBADF on stderr
ui.write_err already swallows EPIPE and EIO if a write to stderr fails.
On Mac OS X at least, a write to a closed file descriptor results in
EBADF. Before this patch, hg would exit with status 1 if a write to
stderr failed during startup (e.g. while trying to print a warning about
not finding an extension):

  $ ./hg --config extensions.foo= version 2>&-; echo $?
  1

With this patch, it correctly swallows stderr and continues to run the
command:

  $ ./hg --config extensions.foo= version 2>&-
  Mercurial Distributed SCM (version 2.1)
  ...
2012-04-04 12:46:54 -05:00
Jim Hague
77587a4c7a tests: avoid test-hup hanging on AIX
test-hup hangs on AIX. Under ksh89 on AIX (the default shell),

echo Hello; while [ ! -s not-there ]; do true; done

produces no output while the loop executes. Replacing 'true' with 'sleep 0'
fixes, as does using a less broken shell. ksh93 is fine.

Update check-code.py to look for this, and make same change in test-serve.t.
In fact test-serve works fine, probably because of additional commands between
echo and the loop, but that's a subtlety not easy to test for.
2012-04-05 12:31:21 +01:00
Patrick Mezard
1e2e55778b mdiff: fix diff header generation for files with spaces (issue3357)
diff ---/+++ should end filenames with a TAB when they contain spaces. Current
code failed to do so when only the +++ file had spaces. This only happened with
git renames from a name without space to one with space.
2012-04-05 15:39:07 +02:00
Patrick Mezard
f535cae825 context: make changectx.mutable() benefit from .phase() logic
This fixes "hg qimport -r null". Previous versions used to:
- Traceback because null revision mutability was not defined
- Add an empty -1.diff patch to the series

The error message:

  abort: revision -1 is not mutable

is symptomatic of a deeper problem in phase command revision handling. It could
be fixed easily in the command itself but I feel a better fix must be done in
phase API which raises the issue of phase updates atomicity: aborting in
phases.advanceboundary/retractboundary requires a better rollback behaviour to
avoid partial changes.
2012-04-05 19:15:23 +02:00
Thomas Arendsen Hein
7c3a892f08 export: catch exporting empty revsets (issue3353)
Additionally add tests for empty revsets and unknown revisions.
2012-04-04 12:31:31 +02:00
Thomas Arendsen Hein
a93a526aeb test-merge-types: allow different output with existing hgmerge (issue3346)
Because hgmerge was meant to be adjusted to personal needs, there may be
many remaining copies in people's $PATH.
2012-04-04 11:18:42 +02:00
Thomas Arendsen Hein
567734318a inotify: catch SignalInterrupt during shutdown (issue3351)
When inotify.repowatcher.shutdown() is called, mercurial.error.SignalInterrupt
exception is thrown by mercurial.dispatch._runcatch.catchterm(), therefore
socketlistener.shutdown() is not called.

Catching this allows cleanup action (removing the socket file) to proceed.
2012-04-04 10:57:48 +02:00
Thomas Arendsen Hein
5e3d9e57d7 clone: always close source repository (issue2491)
This is especially needed for cloning from bundles as a temporary
bundlerepository is created which needs to be deleted after clone has
finished.
2012-04-03 22:01:28 +02:00
Thomas Arendsen Hein
21bb7c4cdc tests: make tests work if directory contains special characters
With this quoting tests will work e.g. in "/tmp/foo bar/mercurial/".
2012-04-03 19:06:35 +02:00
Thomas Arendsen Hein
10f14ea780 test-gpg: replace 83b32bd12586 by md5sum check
The call to 'hg identify' would have needed '--cwd "$TESTDIR' to make it work
anyway, but by using a checksum this test can work outside a repository.
2012-04-03 16:36:25 +02:00
Javi Merino
c4e6d14c1e tests: don't run test-gpg if not in a working directory
test-gpg has to be run in a mercurial working directory as it uses
that to verify that it hasn't modified the trustdb.gpg file.  Skip the
test if it is running in an exploded tarball.
2012-04-02 22:25:55 +01:00