Commit Graph

55 Commits

Author SHA1 Message Date
Dan Villiom Podlaski Christiansen
aa4c534f6e test_util: allow counting converted revisions
...and while at it, use a more reliable test for filtering out
obsolete revisions.
2013-08-10 07:46:21 +02:00
Dan Villiom Podlaski Christiansen
5da42c1256 test_util: include Subversion revision when drawing a pretty graph 2013-08-11 22:20:59 +02:00
Dan Villiom Podlaski Christiansen
8325383a34 test_fetch_command: use stupid mode metaclass 2013-08-09 23:45:54 +02:00
Dan Villiom Podlaski Christiansen
85cd99fb26 test_fetch_commands: make a failure more readable 2013-08-09 20:18:31 +02:00
Dan Villiom Podlaski Christiansen
ad44214b16 tests: count revisions explicitly
The assumption that len(repo) corresponds to the count of actual,
usable revision in the repository fails in presence of hidden
revisions. Instead, we use a dedicated method in test_util, and change
all tests to use this for obtaining repository length -- just to be
safe...
2013-08-09 11:22:50 -04:00
Dan Villiom Podlaski Christiansen
eead92fd0e handle invalid UTF-8 in commit messages consistently
4f580a26849f fixed this for replay, but not for stupid mode; we
address this by consolidating our means of generating a Mercurial
commit message in a single function in 'util.py'.
2013-08-08 09:38:55 +02:00
Dan Villiom Podlaski Christiansen
b360f4a66d tests: remove old test-loading infrastructure
(for those in the know, this is known as a suitectomy)
2013-08-07 16:00:52 +02:00
Patrick Mezard
1c33a3ec2d tests: add tests where files are moved from root to trunk
It triggers a special case of missing path with a different root layout.
2012-10-20 22:24:32 +02:00
Patrick Mezard
89373467f1 stupid: do not close branch upon branch-wide revert
Reverting a branch with a remove followed by a copy results in a branch
replacement. By default, branch replacements are handled by closing the
replaced branch and committing the new branch on top of it. But we do
not really want that when reverting a branch, we only want a linear
history with a changeset capturing the revert.
2012-10-16 21:17:55 +02:00
Patrick Mezard
0e46c925de editor: relax copyfrom dir checks to avoid extra missing entries
When renaming a branch you get something like:

  D /branch/bar
  A /branch/foo (from /branch/foo:42)

Unfortunately, the branch layout for the revision being converted is
computed before starting to convert it. It means the copyfrom path
supplied in the add_directory() for /branch/foo will be be considered
invalid, be added to missing and fetched the slow way despite being in
the repository history. Avoid that by checking the path looks like a
branch path and matching it with the filemap. It will be resolved
afterwards anyway.
2012-10-06 10:10:35 +02:00
Patrick Mezard
0d98dd5413 editor: start separating svn copies from open files
The separation is not complete as we still have to update the
RevisionData deleted set when registering svn copies. This will be
cleaned up once open files are themselves separated from RevisionData.

Copied symlinks are also being prefixed with 'link '.
2012-10-03 21:27:02 +02:00
Patrick Mezard
2d9c4aef5c test_fetch_command: fix if local encoding is not UTF-8
changectx.description() returns what changelog.read() returns which
is a description in local encoding. Convert that back to UTF-8 before
trying to decode it as UTF-8.
2012-08-26 19:49:47 +02:00
David Schleimer
26b7e91f9c Ignore invalid utf8 in commit messages
Old svn allowed users to include invalid utf8 in their commits.  Since
there are real repos with said invalid utf8, we need to be able to
import them, even if svn won't.
2012-05-17 14:15:14 -07:00
Patrick Mezard
84977d28d5 test_util: merge load_svndump_fixture() into TestBase 2012-04-19 18:29:28 +02:00
Patrick Mezard
76b3efe6d9 test_util: merge load_fixture_and_fetch() into TestBase method
The middle-term goal is to make TestBase repo_path and wc_path private, so they
can be changed for every load call. This is not required to use nosetests
multiprocess facility as the fixtures create temporary directories but it makes
things much clearer and avoid weird cases where a repository was loaded several
times at the same location in a single test (cf test_startrev). That way we
will be more confident the tests can be parallelized.

The long term goal is to make hgsubversion compatible with nosetests
--processes option.
2012-04-19 18:29:25 +02:00
Yonggang Luo
31a518f718 tests: avoid shadowing Python builtin all() 2011-10-12 15:43:31 +08:00
Yonggang Luo
bebd961e2a globally: clean up whitespace around operators and commas to conform with PEP8
Mostly autoformatted by Eclipse. A few manual corrections were
performed where Eclipse's autoformatter did something non-idiomatic.
2011-10-12 15:35:25 +08:00
Dan Villiom Podlaski Christiansen
7a95293acb svnwrap: fix handling of quotable URLs (fixes #197, refs #132)
The way hgsubversion handles URLs that may or may not be quoted is
somewhat fragile. As part of fixing issue 132 in 06d89c2063a2, the
path component of URLs was always quoted. The URL has been attempted
encoded since the initial check-in.

The fix from 06d89c2063a2 was incomplete; reverting it allows us to
clone a URL with a '~' in it.[1] Encoding the URL as UTF-8 seldom
works as expected, as the default string encoding is ASCII, causing
Python to be unable to decode any URL containing an 8-bit
character.

The core problem here is that we don't know whether the URL specified
by the user is quoted or not. Rather than trying to deal with this
ourselves, we pass the problem on to Subversion. Then, we obtain the
URL from the RA instance, where it is always quoted. (It's worth
noting that the editor interface, on the other hand, always deals with
unquoted paths...)

Thus, the following invariants should apply to SubversionRepo
attributes:
- svn_url and root will always be quoted.
- subdir will always be unquoted.

Tests are added that verify that it won't affect the conversion
whether a URL is specified in quoted or unquoted form. Furthermore, a
test fixture for this is added *twice*, so that we can thoroughly test
both quoted and unquoted URLs. I'm not adding a test dedicated to
tildes in URLs; it doesn't seem necessary.

[1] Such as <https://svn.kenai.com/svn/winsw~subversion>.
2010-10-04 21:00:36 -05:00
Dan Villiom Podlaski Christiansen
ade1537f2e tests: import test_util as the first module in all relevant tests 2010-07-14 15:39:18 +02:00
Augie Fackler
7fc07a22b9 test_fetch_command: handle changes in revision extra ordering gracefully
This allows the tests to pass both with and without revision bfc8a096e3db.
2010-03-01 17:37:00 -06:00
Patrick Mezard
4c315fe286 Rewrite simple_branch.sh fixture from svn dump
I needed it to reproduce the space in branch issue, but failed to do so. At
least I recreated the fixture, so here it is.
2010-02-02 23:20:42 +01:00
Augie Fackler
ae5062ada9 Clean up TODOs that are no longer relevant. 2009-04-13 21:19:13 -05:00
Augie Fackler
04a99bbad0 Move wrappers for hg commands to their own module. 2009-04-10 22:38:29 -05:00
Dirkjan Ochtman
219a0332a1 Fix test_no_dates to not be TZ-sensitive. 2009-04-08 18:29:03 +02:00
Dirkjan Ochtman
34a1dfc322 Cope with date-less revisions. 2009-04-08 13:07:23 +02:00
Augie Fackler
648006ec19 branches: change handling again, but this time a little less magic.
This change means that files located in the actual branches directory will now be wholly
ignored. If we want to handle those correctly, it will take a reasonably large amount of work
and probably a configuration flag. Also, any non-related paths outside of branches/trunk will
be explicitly ignored, which is similar to the somewhat accidental pre-branch-refactor
behavior. Finally, any unrelated files located as children of branches will cause the directory
in branches to be used as the branch - not, as recently was the case, the directory immediately
containing that file.
2009-03-28 16:38:57 -05:00
Augie Fackler
9bb1cfc43f Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Fixed a bunch of tests as a result. This likely will make new conversions of some repos have new revisions in them.
2009-03-27 16:56:07 -05:00
Augie Fackler
6b854b9187 fetch: Fix a bogus case where no files in the root level of trunk caused breakage in the branch detection. 2009-03-09 12:01:40 -05:00
Augie Fackler
5771c60c73 Refactor branch handling to be much more dynamic (and hopefully robust).
This should allow fixing of several outstanding issues with branch handling. Note that this is a *massive* change to one of the oldest parts of hgsubversion, so it might introduce bugs not caught by the testsuite.
2009-03-02 23:58:38 -06:00
Augie Fackler
7c17f8a473 Remove useless imports. 2009-01-21 20:29:23 -06:00
Augie Fackler
c6cb3f3922 fetch: Refactor extra creation to be shared by real and diff replay.
Add convert-compatible meta information to extra.
2008-12-23 11:10:32 -06:00
Patrick Mezard
d194742e5b test_fetch_command: test file and directory deletions 2008-12-15 21:39:35 -06:00
Augie Fackler
5c3930383a diff_cmd: more robust, add tests. 2008-12-11 19:49:36 -06:00
Augie Fackler
5a6b6fb661 Fix an apparent regression where branch name didn't get properly stored for
commits forced on empty branches.
2008-12-11 17:34:33 -06:00
Augie Fackler
b504f748bf tests: Fix a missing pass of stupid=True. 2008-12-11 17:19:43 -06:00
Patrick Mezard
cc0dbae2c2 Move and complete execute bit conversion tests into test_fetch_exec.py 2008-12-10 11:03:18 -06:00
Augie Fackler
4ec9620b80 Fix a regression in converting repositories with files copied in from outside
branches/tags/trunk where repo root != project root.
2008-11-25 16:21:57 -06:00
Augie Fackler
0b3d81a7d5 fetch_command: Fix mis-converted executable when svn:executable was set to the
empty string.
2008-11-25 09:45:38 -06:00
Augie Fackler
e9d74f009c Cleanups based on pyflakes output. 2008-11-21 16:21:19 -06:00
Augie Fackler
effb740fae tests: Mock the mercurial.ui.ui class like we really should to capture output.
Has the nice side effect that we can use nose 0.11's multiprocess plugin.
2008-11-14 16:52:30 -06:00
Patrick Mezard
56c1f22424 Fix basic issues with tests on Windows
- shutil.rmtree() fails if there are any read-only files (svn store)
- Fix files:// URLs
- os.spawnvp()/Popen4() do not exist under Windows, use subprocess
2008-11-09 18:08:35 -06:00
Patrick Mezard
b4460d5cb9 hg_delta_editor: register svn file copies 2008-11-05 13:37:07 +01:00
Augie Fackler
8c7063dc0f Performance fix for branches-from-tags in real replay, which is tied up with
changes that fix problems when trunk is not the oldest branch. Also includes
fixes for copying from a tag that we chose not to create (eg tagging a vendor
branch) and includes tests for all of those things.
2008-11-04 16:38:16 -06:00
Augie Fackler
6a7dd545c7 Fix a bug with added files from outside branches/trunk/tags. 2008-10-27 12:33:52 -05:00
Augie Fackler
327815dcb1 Improved handling of copies from outside of trunk. 2008-10-26 22:39:17 -05:00
Augie Fackler
a4c75a84ab Add a test that proves files in the branches directory don't cause breakage. 2008-10-26 22:12:46 -05:00
Augie Fackler
0463db2112 svn 1.4 and 1.5 have different ideas of diff output for prop changes. 2008-10-09 23:37:22 -05:00
Augie Fackler
3524910c61 Refactor tests so I can reuse code more. 2008-10-08 20:09:28 -05:00
Augie Fackler
e463836499 Add a small stack of tests that exercise some of the interesting special cases. 2008-10-08 18:17:29 -05:00
Augie Fackler
379921079b Add a quick test for diff-based pull. 2008-10-08 08:14:31 -05:00