Commit Graph

695 Commits

Author SHA1 Message Date
Dan Villiom Podlaski Christiansen
aca3f33ea4 test_push_dirs.py: activate tests that were previously overlooked
The existing tests were rather weird, so they were cleaned up a bit
while at it.
2010-09-23 15:27:08 +02:00
Dan Villiom Podlaski Christiansen
647475e9a2 tests_urls: activate a test that was previously overlooked 2010-09-14 19:24:55 +02:00
Dan Villiom Podlaski Christiansen
4cb42fcb70 svnwrap: improve error message when no bindings are found. 2010-09-14 15:25:45 +02:00
Dan Villiom Podlaski Christiansen
bd458ffecd testrunner: don't use os.putenv(), as it may not affect os.environ. 2010-09-14 15:25:45 +02:00
Dan Villiom Podlaski Christiansen
1447707dac tests: enable hgsubversion in the generated UI.
This allows testing hgsubversion using Mercurial's dispatch logic.
2010-09-20 17:08:18 +02:00
Dan Villiom Podlaski Christiansen
6909ff1bc2 subvertpy_wrapper: don't assume the version is a three-tuple (fixes #206)
0.7.3.1 breaks this. While at it, the capitalisation of `Subvertpy' is
made consistent, and the Subversion tag, if present, is included in
the output.
2010-09-14 21:02:49 +02:00
Peter Arrenbrecht
76a82dfc04 subvertpy: set default username/pwd as with swig
Fixes wrong user name being used for pushed commits.
2010-09-15 17:50:30 +02:00
Peter Arrenbrecht
293fa6f0e3 clone: add --singlebranch option
Allows one to specify branch name for layout=single without an external
branchmap file.
2010-09-15 17:49:27 +02:00
Peter Arrenbrecht
700d808aa5 push: simplify code for remapping rebased node ids 2010-09-10 07:50:40 +02:00
Peter Arrenbrecht
01cf3d3249 push: fix case where we get >1 revs back after svn commit
This hinges on looking not only at children(), but at descendants()
to find things.
2010-09-08 10:43:02 +02:00
Peter Arrenbrecht
1f827f21a6 tests: remove constant rev no from test script 2010-09-08 10:42:53 +02:00
Peter Arrenbrecht
d062cf3266 tests: move _add_svn_rev to test_util for reuse 2010-09-08 09:57:06 +02:00
Peter Arrenbrecht
77db23cd88 tests: add --show-stdout option to run.py 2010-09-08 09:50:11 +02:00
Augie Fackler
371ea77f68 templatekw: restore compatibility with hg < 1.5
The templatekw module was new in 1.5 - it looks nontrivial to extend the
templater in 1.4.x and earlier, so just disable this feature on those
versions.
2010-09-06 17:08:11 -05:00
Dan Villiom Podlaski Christiansen
97cdf7efab subversion.rst: mention lack of directory tracking (see issue 202) 2010-09-03 00:35:47 +02:00
Dan Villiom Podlaski Christiansen
d7bb1d26a9 subversion.rst: fix 'typo' in help for the hgsubversion.defaultauthors option. 2010-09-03 00:35:47 +02:00
Andi Albrecht
a78b4072d4 Add svnrev, svnpath and svnuuid keyword.
Based on a patch by Wagner Bruna posted here:
http://groups.google.com/group/hgsubversion/browse_thread/thread/b3913337e021ab18
2010-09-02 21:30:17 +02:00
Dan Villiom Podlaski Christiansen
c89cce5b08 tests: add a Makefile for easily running the tests.
The Makefile tests one thing which isn't easily tested from within
Python; that the svnwrap modules aren't loaded for irrelevant
commands.
2010-09-03 00:35:12 +02:00
Dan Villiom Podlaski Christiansen
9e169923eb tests: add an option to the test-runner for selecting bindings. 2010-09-02 23:23:02 +02:00
Dan Villiom Podlaski Christiansen
780271249e setup: require Subvertpy when the SWIG bindings are unavailable.
This isn't quite good enough if the Subversion installation is
too old, but we'd have to replicate the actual version check to deal with
that.
2010-08-11 19:57:35 +02:00
Dan Villiom Podlaski Christiansen
7bc9b7dc45 svnwrap: add runtime override for choice of Subversion bindings
By setting the `HGSUBVERSION_BINDINGS environment variable to either
`SWIG' or `Subvertpy', the choice of bindings can be forced at
runtime. (For ease of use, the comparison is case-insensitive.)

Examples:

% HGSUBVERSION_BINDINGS=swig hg version --svn
Mercurial Distributed SCM (version 1.6+172-b25e1ced9861)
...
hgsubversion: 1.1.2+43-276742da2d85
Subversion: 1.6.12
bindings: SWIG

% HGSUBVERSION_BINDINGS=subvertpy hg version --svn
Mercurial Distributed SCM (version 1.6+172-b25e1ced9861)
...
hgsubversion: 1.1.2+43-276742da2d85
Subversion: 1.6.12
bindings: Subvertpy 0.7.4

% HGSUBVERSION_BINDINGS=none hg version --svn
Mercurial Distributed SCM (version 1.6+172-b25e1ced9861)
...
abort: cannot use hgsubversion; bindings disabled using HGSUBVERSION_BINDINGS!
2010-08-11 20:03:47 +02:00
Dan Villiom Podlaski Christiansen
758d2945c3 README: mention Subvertpy.
Change the README to mention Subvertpy and provide help on how to
check that hgsubversion works properly.
2010-08-11 20:03:26 +02:00
Dan Villiom Podlaski Christiansen
6b99ad8b96 svnwrap: suggest installing Subvertpy when no bindings are present 2010-08-11 19:57:35 +02:00
Dan Villiom Podlaski Christiansen
da9aad1d2b svnwrap: activate & prefer subvertpy bindings when available
All tests pass.
2010-08-11 19:57:35 +02:00
Dan Villiom Podlaski Christiansen
6792daee4e svnwrap: add subvertpy wrapper
Subvertpy is, in many ways, a better interface to Subversion than the
SWIG bindings. It's faster, leaks less and offers a cleaner API. The
added wrapper is able to coexist with the SWIG wrapper, and not
enabled by default. In order to allow this, the wrapper adapts the
output from Subvertpy so that it is similar to the output from the
SWIG bindings. An example of this can be seen in the modules that work
with editors: the nested editors offered by Subvertpy had to be
flattened to work with our editor code.

This change does not activate the Subvertpy wrapper, yet, and thus
does not affect any functionality.
2010-08-11 19:57:35 +02:00
Dan Villiom Podlaski Christiansen
faf346e7b2 svnwrap: improve a docstring & a comment.
The docstring for SubversionRepo was technically inaccurate; not only
do we require Subversion 1.5, but the reference to a required
parameter is inaccurate, as the parameter has a default value. (To be
fair, relying on the default value is unlikely to work...)

Part of a comment in SubversionRepo.revisions() was redundant, and
could be removed.

No functionality change.
2010-08-11 19:57:35 +02:00
Dan Villiom Podlaski Christiansen
b11a1e2880 svnwrap: use decorator syntax for properties.
The original reason not to use property syntax was that it didn't work
with Python 2.3. Mercurial dropped support for it more than a year
ago...

No functionality change.
2010-08-11 19:57:35 +02:00
Dan Villiom Podlaski Christiansen
9ecf2e60f4 editor: move ieditor decorator into svnwrap.
The Subvertpy wrapper will not need this decorator, and moving the
decorator into svnwrap will allow the wrapper to provide a no-op
replacement.

No functionality change.
2010-08-11 19:57:35 +02:00
Dan Villiom Podlaski Christiansen
cc2a46ccb8 svnwrap: factor out a common module
The new `common' module holds code not specific to the SWIG
wrapper. Factoring it out makes providing multiple wrappers easier.

No functionality change, although imports in one test were updated.
2010-08-11 19:57:35 +02:00
Peter Arrenbrecht
edcee72d6c svnmeta: strip all repeated slashes from subdir 2010-07-28 14:47:44 +02:00
Augie Fackler
7e4f52d9e0 Merge backout of incorrect patch. 2010-08-20 20:37:54 -05:00
Augie Fackler
d4b3e11d95 Backed out changeset a020cfb8383b
I applied the wrong version of Peter's patch.
2010-08-19 10:52:38 -05:00
Dan Villiom Podlaski Christiansen
a9ce123185 svnwrap: s/_chunk_size/chunk_size/
The underscore prefix suggests that the chunk_size is a private
variable. There's no reason for this, so we remove it in preparation
for a refactoring.

No functionality change.
2010-08-11 19:57:35 +02:00
Dan Villiom Podlaski Christiansen
97e4658b48 svnwrap: s/core.SubversionException/SubversionException/
A recent change made core.SubversionException a member of
svnwrap. Referencing it directly makes the code ever so slightly
cleaner.

No functionality change.
2010-08-11 19:57:35 +02:00
Dan Villiom Podlaski Christiansen
8481d5ccec svnwrap: remove dead code
Some member functions of SubversionRepo were unused, and removing them
frees other wrappers from adding possibly incorrect implementations of
them.

Two methods, `tags_at_rev' and `_get_copy_source' were completely
unused and could easily be removed. Another two methods, `branches'
and `tags' had explicit tests for them but weren't used in the code
proper; they were removed too. The START property was unnecessary and
could be removed with a tiny refactoring.

No functionality change.
2010-08-11 19:57:35 +02:00
Dan Villiom Podlaski Christiansen
295c0a8c6d svnwrap: kill the ctypes wrapper.
The wrapper was never anywhere near functional, and with the upcoming
subvertpy wrapper, the need for it has diminished. If the
implementation is ever completed, the code can be recovered from the
history of the repository.

No functionality change.
2010-08-11 19:57:34 +02:00
Dan Villiom Podlaski Christiansen
e2e9fb4206 version: mention bindings type in version
In addition, the version output has been rejiggered a bit to mention
the version of hgsubversion first.

While at it, `svn' is changed to `Subversion', as this is its the
proper name.

Before:

% hg version --svn
...
svn bindings: 1.6.12
hgsubversion: 1.1.2+45-123ac53a6343

After:

% hg version --svn
...
hgsubversion: 1.1.2+45-123ac53a6343
Subversion: 1.6.12
bindings: SWIG
2010-08-11 19:57:34 +02:00
Dan Villiom Podlaski Christiansen
cf9817176c tests: add a fixture that exercises the fix made in bcaf0cafd37b. 2010-08-14 21:31:33 +02:00
Dan Villiom Podlaski Christiansen
58d39f3954 README: remove usage instructions, and refer to the help topic instead.
The diff for the change can be somewhat hard to read, but all it does
is replace the `Basic Use' and `Support for svn:externals' sections
with the following section:

Further Reading
---------------

More information on how to use hgsubversion is available from within Mercurial
in the `subversion` help topic. To view it, use::

 $ hg help subversion

The Restructured Text source for this topic is also available in the file
``hgsubverson/help/subversion.rst``.
2010-08-11 19:57:34 +02:00
Peter Arrenbrecht
7d966a6696 svnmeta: strip all repeated slashes from subdir 2010-07-27 15:26:31 +02:00
Dan Villiom Podlaski Christiansen
489ce37a15 __init__: activate & advertise the new help topic. 2010-08-11 19:57:34 +02:00
Dan Villiom Podlaski Christiansen
934f019d60 help: add an rst file containing some helpful instructions
The new file contains three sections: The first one is based on the
README and contains instructions on how to use hgsubversion. The
second one mentions the most notable shortcomings of hgsubversion. The
third and final section documents how to customise hgsubversion.
2010-08-11 19:57:34 +02:00
Dan Villiom Podlaski Christiansen
2bea7540e4 test_startrev: add a few assertions about clone lengths
A few tweaks are added to the test to ensure that all tests pass these
assertions:

Some fixtures fail them by resulting in empty clones. Explicitly
blacklisting such fixtures allows as to ensure that the other fixtures
continue to work as expected.

Other fixtures contain no files in trunk at HEAD, so we test them with
other subdirectories instead.
2010-08-11 19:57:34 +02:00
Dan Villiom Podlaski Christiansen
6c73b1f82f pull: fix shallow clone when lastest change isn't HEAD.
Previously, using `hg clone --startrev HEAD` when the actual HEAD
revision didn't touch the prefix, would cause it to report that no
changes were found. Using last_changed_rev instead of HEAD fixes
this. In order to better test this scenario, we now clone the trunk
subdirectory of all the fixtures.
2010-08-11 19:57:34 +02:00
Dan Villiom Podlaski Christiansen
22ba8a8561 stupid: remove an incorrect, implicit assumption in fetch_branchrev()
The code in fetch_branchrev() could fail under relatively obscure
circumstances: it combined two strings (path & child) by concatenating
them with '/' inserted in the middle. However, convert_rev() contains
an assertion that no touched file paths start with '/'. Combined,
these two amounted to an incorrect assumption that no files where
touched within an empty branchpath.
2010-08-11 19:57:34 +02:00
Dan Villiom Podlaski Christiansen
57e5b36411 test_rebuildmeta: make an assertion more helpful. 2010-08-06 14:43:40 +02:00
Dan Villiom Podlaski Christiansen
193982913d verify: add end-of-line to ui.write() calls.
It's prettier this way.
2010-08-06 14:43:40 +02:00
Dan Villiom Podlaski Christiansen
aac6b0771c test_startrev: new tests inspired by test_rebuildmeta
The tests for start revision support are inspired by the rebuildmeta
tests; for every single fixture, a full and a shallow clone is
performed, and the two are then compared.
2010-07-20 12:53:47 +02:00
Dan Villiom Podlaski Christiansen
a2c34f3e2b test_util: support specifying a start revision 2010-07-20 11:55:07 +02:00
Dan Villiom Podlaski Christiansen
062f37ee07 clone: allow specifying a start revision.
All tests pass, including comprehensive tests.
2010-07-20 11:55:07 +02:00