Commit Graph

89 Commits

Author SHA1 Message Date
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
Bryan O'Sullivan
dc0310ba92 pull: add a hgsubversion.unsafeskip option to omit unwanted revs 2012-05-16 16:52:25 -07:00
Bryan O'Sullivan
980a7406ee canonicalize svn paths even more awesomely
It turns out that SVN has bizarre path canonicalization rules that
are sort of close to what urllib.quote does, but different in
peculiar ways, and 1.7 suddenly cares deeply about canonicality.
For instance, space (' ') maps to %20, but '~' stays unchanged
instead of turning into %7e.

Along with its new policy of frequent beatings administered to users
of its bindings, SVN 1.7 introduces a function that idempotently
canonicalizes URIs, which I found sort of by accident, because
that's how you learn about SVN API changes.

Older versions of SVN are less anal, so urllib.quote continues to
work fine for them.
2012-05-14 01:13:07 +02:00
Bryan O'Sullivan
d3491e56a5 replay: workaround svn not telling us about x/l flags (issue346) 2012-05-13 15:28:50 +02:00
Dan Villiom Podlaski Christiansen
19bb35256e svn verify: add a test for corrupt repositories.
This case contains a couple of unlikely (but not impossible) failure
cases that the code previously did not handle. The verifier is updated
to address these, and the output made a bit more consistent.
2011-12-14 00:07:58 +01:00
Dan Villiom Podlaski Christiansen
d919aa5162 svnmeta: only remove directory components in normalize()
Previously, a file beginning with the repository subdirectory would be
stripped, resulting in a leftover file name with a wrong name. A
subsequent pull of a revision modifying the file would add it under
its correct name, but leave the leftover file.
2011-12-14 00:07:57 +01:00
Patrick Mezard
2cb05fac47 test_utility_commands: test verify command
Also, make verify output more stable.
2012-04-21 11:36:23 +02: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
Augie Fackler
e4889e1065 svnmeta: store youngest revision pulled from subversion
This prevents re-pulling the same revision over and over, which was a
problem when the most recent revision was a tagging revision that
wouldn't exist properly in the revmap. This should also allow users to
not re-pull huge volumes of commits that have no effect on the hg
repository.
2011-05-24 21:07:27 -05:00
Patrick Mezard
ab5442dcd2 replay: copy copied directories externals 2011-03-09 22:07:26 +01:00
Patrick Mezard
8a978b45f6 externals: ignore externals blank or comment lines 2011-03-02 21:06:30 +01:00
Dan Villiom Podlaski Christiansen
e7e5d3b8b5 configurable substitution for empty commit message (fixes #195)
The value of the default commit message is now configurable by setting
'hgsubversion.defaultmessage'. In addition, the log output is made
consistent with the result of the conversion.
2010-11-28 03:47:04 +01:00
Dan Villiom Podlaski Christiansen
266d07be60 editor: handle property changes to links.
Previously, property changes to links caused 'link ' to be prepended
to the link destination. Removing a line that prepended it in
Revision::set() appears to fix it. In these cases, the "file marked as
link, but contains data" warning might be triggered. This should be
safe, so it's lowered to a note and the language made less conclusive.

In order to test this, extra revisions are added to the
'symlinks.svndump' fixture. As one of the new revisions add a link
that points to 'link to this', a check that asserted that link
destinations must not start with 'link ' was removed. This change is
safe, as the test later on asserts exact equality with the contents of
the 'links' dictionary.
2010-11-09 13:05:16 +01:00
Dan Villiom Podlaski Christiansen
2fa6c3592c maps: map a missing author to '(no author)'
"None" doesn't really make much sense, so we use what 'svn log' shows
instead. This also fixes mapping this author to something else.
2010-10-09 16:20:52 -05: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
cf9817176c tests: add a fixture that exercises the fix made in bcaf0cafd37b. 2010-08-14 21:31:33 +02:00
Dan Villiom Podlaski Christiansen
4f810ba607 branchmap: map empty commits in replay mode. 2010-07-10 14:19:24 +02:00
Patrick Mezard
8114ffd92c stupid: fix getcopies() logic
getcopies() assumed that copies where happening withing the current branch.
This is wrong when a branch replaces another, and used to generate wrong copy
records when copy sources existed in parent revision but were coming from an
unrelated revision.
2010-03-02 17:06:06 +01:00
Patrick Mezard
566a8fca5b editor: fix replaced directory copies
Known failures:
- Replaced directories copy records are wrong in stupid mode
- Replaced files copy records are probably wrong in all modes
2010-03-02 17:06:06 +01:00
Patrick Mezard
c47bdbcb15 editor: fix issamefile() and copy detection in replay mode
Known failures:
- comprehensive/test_verify on replace_branch_with_branch: replaced files
  content is incorrect
- comprehensive/test_stupid_pull on replace_branch_with_branch: very stupid
  mode does not handle replacements correctly.
2010-03-02 17:06:06 +01:00
Patrick Mezard
2977e6b7da Add rsvn.py to test tools 2010-03-02 17:06:06 +01:00
Dirkjan Ochtman
7e2d3d3d2b add basic branchmap functionality, to rename branches 2010-03-01 22:10:18 +01:00
Augie Fackler
d4c3b3a0d2 replay: correctly handle renaming the parent dir of a branch 2010-02-06 13:01:35 -06:00
Augie Fackler
f5c9436c75 tags: fix files edited during tag creation
This was broken because file edits were skipped if they were in tags, but
committags in svnmeta didn't check to see if any files were changed during
initial tag creation.
2010-02-06 10:36:21 -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
Patrick Mezard
b65db876b5 Extend issue119 to full original weirdness 2010-02-02 21:36:08 +01:00
Patrick Mezard
025b9eab8d test_tags: rewrite both the test and the fixture script
I needed this to debug it after changes in tagging code.
2010-01-29 23:36:14 +01:00
Patrick Mezard
8e750663c7 Handle tag subdirectory as tag in replay mode (issue119)
Original version by Dirkjan Ochtman <dirkjan@ochtman.nl>
2010-01-22 18:01:19 -06:00
Augie Fackler
15d8f2ac36 tests: test paths with spaces 2009-12-24 13:38:06 -06:00
Dirkjan Ochtman
a7e59a56e2 try to deal with weirdly located branches in rebuildmeta (#118) 2009-09-22 16:46:16 +02:00
Augie Fackler
c7cf7e9acc Add a test for URLs that have spaces in them. 2009-09-15 21:57:17 -04:00
Augie Fackler
f12e0f5220 tags: handle the most recent commit being an edit to an svn tag properly 2009-07-18 22:30:59 -05:00
Max Bowsher
ba817049eb Fix 'parent dir of a branch is deleted' refactoring from 343da84. 2009-07-04 18:12:18 +01:00
Augie Fackler
0b5a9621bd tags: handle copyfrom old versions of tags more correctly 2009-07-01 14:42:46 -05:00
Augie Fackler
3a686b9460 tags: allow editing tags of closed branches without reopening the branch 2009-06-26 14:53:58 -05:00
Augie Fackler
e38b2d76ae tags: handle tags from edited tags. 2009-06-26 11:12:14 -05:00
Augie Fackler
7d59773522 tags: Handle edits to edited tags. 2009-06-26 10:34:32 -05:00
Augie Fackler
088caa5246 tags: handle editing a tag and its source branch simultaneously 2009-06-23 22:15:20 -05:00
Augie Fackler
2c9a8097db tags: handle edits to tags as gracefully as possible 2009-06-23 21:38:27 -05:00
Dirkjan Ochtman
c9ba1e00a4 maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Author maps for the Python repo got truncated because of the author map stupidly
writing upon itself. This patch implements a better and faster scenario, where
entries will only be written to the saved author map if they're not coming from that
file. They're also now streamed into the file directly, instead of having to re-open
the file on every entry, and formatting is preserved.
2009-06-15 16:09:27 +02:00
Dirkjan Ochtman
0c6b24e964 branches: correctly deal with branch closing directly after copy/rename 2009-06-11 18:00:58 +02:00
Augie Fackler
6464b37601 tags: Fix an improper parent calculation. 2009-06-01 11:21:47 -05:00
Augie Fackler
c8e1c2c71d tags: fix handling for certain nonstandard tag layouts. 2009-05-30 20:18:14 -05:00
Augie Fackler
f7aa9c1fa8 test_tags: Add a test that verifies tags get deleted properly even in the presence of somewhat odd branching. 2009-05-30 19:46:03 -05:00
Dan Villiom Podlaski Christiansen
4464869581 Remove the 'outgoing' wrapper, and use the Mercurial infrastructure instead. 2009-05-22 15:12:31 +02:00
Patrick Mezard
e2670e5557 svnexternals: do not use peg revisions as --rev replacements
Peg revisions are now parsed separately. If a revision is supplied but not a
peg revision, we used the former as peg revision, as subversion seems to do.
2009-05-03 21:42:44 -05:00
Patrick Mezard
b4010e516b hg_delta_editor: detect new branches issued from non-branch directories
This fix solves the following case: let's /dumb/layout/project be an existing
project. To normalize the trunk/branches/tags layout, people may do:

$ mkdir /project
$ mv /dumb/layout/project /project/project
# Oups, should have been trunk!
$ mv /project/project /project/trunk

trunk creation was ignore because:
- update_branch_map() sees it come from a non-branch copy source and ignores it
  (case #3).
- since it is not in self.branches, add_directory() ignores the non-existing path.
Then trunk is left uninitialized.

To solve this, we allow update_branch_map() to detect branches copied from
non-canonical locations.
2009-05-03 21:42:42 -05:00
Augie Fackler
eb099e394a Added a test case for directory-add behavior when repo root is not project root. 2009-04-14 22:44:19 -05:00
Dirkjan Ochtman
34a1dfc322 Cope with date-less revisions. 2009-04-08 13:07:23 +02:00
Augie Fackler
9aa46bc305 Fix and test for directory deletes during branch creation. 2009-04-07 17:38:13 -05:00