Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Jul 28, 2012
  1. Turn on canonicalization on newly minted URLs.

    Go through all the spots that use the new add_path_to_url() to
    make a new URL and canonicalize them.
    * copyfrom_path has to be canonicalized else find_parent_branch
      will get confused
    * due to the `canonicalize_url($full_url) ne $full_url)` line of
      logic in gs_do_switch(), $full_url is left alone until after.
    At this point SVN 1.7 passes except for 3 tests in that look like an SVN bug to do with
  2. Add function to append a path to a URL.

    Remove the ad-hoc versions.
    This is mostly to normalize the process and ensure the URLs produced
    don't have double slashes or anything.
    Also provides a place to fix the corner case where a file path
    contains a percent sign.
  3. Canonicalize earlier in a couple spots.

    Just a few things I noticed.  Its good to canonicalize as early as
  4. Replace hand rolled URL escapes with canonicalization

    Continuing to move towards getting everything canonicalizing the same way.
    * Git::SVN->init_remote_config and Git::SVN::Ra->minimize_url both
      have to canonicalize the same way else init_remote_config
      will incorrectly think they're different URLs causing to fail.
  5. Improve our URL canonicalization to be more like SVN 1.7's.

    Previously, our URL canonicalization didn't do much of anything.
    Now it actually escapes and collapses slashes.  This is mostly a cut & paste
    of escape_url from git-svn.
    This is closer to how SVN 1.7's canonicalization behaves.  Doing it with
    1.6 lets us chase down some problems caused by more effective canonicalization
    without having to deal with all the other 1.7 issues on top of that.
    * Remote URLs have to be canonicalized otherwise Git::SVN->find_existing_remote
      will think they're different.
    * The SVN remote is now written to the git config canonicalized.  That
      should be ok.  Adjust a test to account for that.
  6. Fix typo in test

    Test to check that the migration got rid of the old style git-svn directory.
    It wasn't failing, just throwing a message to STDERR.
  7. SVN 1.7 will truncate "not-a%40{0}" to just "not-a".

    Rather than guess what SVN is going to do for each version, make the test use
    the branch name that was actually created.
  8. Make Git::SVN and Git::SVN::Ra canonicalize paths and urls.

    This canonicalizes paths and urls as early as possible so we don't
    have to remember to do it at the point of use.  It will fix a swath
    of SVN 1.7 problems in one go.
    Its ok to double canonicalize things.
    SVN 1.7 still fails, still not worrying about that.
  9. Switch path canonicalization to use the SVN API.

    All tests pass with SVN 1.6.  SVN 1.7 remains broken, not worrying
    about it yet.
    SVN changed its path canonicalization API between 1.6 and 1.7.
    The SVN API does not accept foo/.. but it also doesn't canonicalize
    it.  We have to do it ourselves.
  10. Remove irrelevant comment.

    The code doesn't use File::Spec.
  11. Add join_paths() to safely concatenate paths.

    Otherwise you might wind up with things like...
        my $path1 = undef;
        my $path2 = 'foo';
        my $path = $path1 . '/' . $path2;
    creating '/foo'.  Or this...
        my $path1 = 'foo/';
        my $path2 = 'bar';
        my $path = $path1 . '/' . $path2;
    creating 'foo//bar'.
    Could have used File::Spec, but I'm shying away from it due to SVN
    1.7's pickiness about paths.  Felt it would be better to have our own
    we can control completely.
Commits on Jul 27, 2012
  1. Extract, test and enhance the logic to collapse ../foo paths.

    The SVN API functions will not accept ../foo but their canonicalization
    functions will not collapse it.  So we'll have to do it ourselves.
    _collapse_dotdot() works better than the existing regex did.
    This will be used shortly when canonicalize_path() starts using the
    SVN API.
  2. Change canonicalize_url() to use the SVN 1.7 API when available.

    No change on SVN 1.6.  The tests all pass with SVN 1.6 if
    canonicalize_url() does nothing, so tests passing doesn't have
    much meaning.
    The tests are so messed up right now with SVN 1.7 it isn't really
    useful to check.  They will be useful later.
  3. Move the canonicalization functions to Git::SVN::Utils

    So they can be used by others.
    I'd like to test them, but they're going to become SVN API wrappers shortly
    and those aren't predictable.
    No functional change.
  4. Change the rest of the code to use the Git::SVN and Git::SVN::Ra url …

    Note: The structure returned from Git::SVN->read_all_remotes() does not appear to
    contain objects, so I'm leaving them alone.
    That's everything converted over to the url and path accessors.
    No functional change.
  5. Change the rest of the code to use Git::SVN->path instead of the hash…

    … directly.
    No functional change.
  6. Make Git::SVN::Ra use an accessor for URLs

    Later it can canonicalize automatically.
    A later change will make other things use the accessor.
    No functional change.
  7. Make Git::SVN use an accessor for URLs internally.

    So later it can do automatic canonicalization.
    A later patch will make other things use the accessor.
    No functional change here.
  8. Make Git::SVN use accessors internally for path.

    Then later it can be canonicalized automatically rather than everywhere
    its used.
    Later patch will make other things use it.
  9. Fix indents to match style.

  10. Extract Git::SVN::GlobSpec from git-svn.

    Straight cut & paste.  That's the last class.
    * Make Git::SVN load it on its own, its the only thing that needs it.
  11. Move Git::IndexInfo into its own file.

    Straight cut & paste.  Didn't require any fixing.
  12. Load all the modules in one place and before running code.

    Just makes the code easier to follow.  No functional change.
    Also eliminate an unused lexical $SVN.
  13. Extract Git::SVN::Migration from git-svn.

    Straight cut & paste.
  14. Prepare Git::SVN::Migration for extraction from git-svn.

    * Load Git command functions on its own.
    * Load Git::SVN modules on its own.
    Drive by refactorings...
    * Use our() instead of use vars.
    * Eliminate the auto loading of Git functions.
  15. Extract Git::SVN::Log from git-svn.

    Straight cut & paste.
    Also noticed Git::SVN::Ra wasn't in the compile test.  It is now.
  16. Prepare Git::SVN::Log for extraction from git-svn.

    * Load Git command functions itself.
    * Can't access the git-svn switch lexical any more, but its only used by
      Git::SVN::Log so turn it into a Git::SVN::Log global.
    * Load Git::SVN as needed.  No need to load it always, its only used twice.
    * Moved a state variable to the routine it's used for. (Drive by refactoring)
  17. Move initialization of Git::SVN variables into Git::SVN.

    Also it can compile on its own now, yay!
  18. Extract Git::SVN from git-svn into its own .pm file.

    Except for adding the 1; at the end, this is a straight copy & paste.
    Tests still pass, but its doubtful Git::SVN will compile on its own
    without git-svn being loaded.  Next commit will fix that.
  19. Prepare Git::SVN for extraction into its own file.

    This means it should be able to load without git-svn being loaded.
    * Load on its own and all the needed command functions.
    * It needs to grab at a git-svn lexical $_prefix representing the --prefix
      option.  Provide opt_prefix() for that.  This is a refactoring artifact.
      The prefix should really be passed into Git::SVN->new.
    * Unqualify unnecessarily fully qualified globals like
    * Lexically isolate the class just to make sure nothing is leaking out.
  20. Extract some utilities from git-svn to allow extracting Git::SVN.

    Put them in a new module called Git::SVN::Utils.  Yeah, not terribly
    original and it will be a dumping ground.  But its better than having
    them in the main git-svn program.  At least they can be documented
    and tested.
    * fatal() is used by many classes.
    * Change the $can_compress lexical into a function.
    This should be enough to extract Git::SVN.
    Signed-off-by: Michael G. Schwern <>
  21. The Makefile.PL will now find .pm files itself.

    It is no longer necessary to manually add new .pm files to the
    Makefile.PL.  This makes it easier to add modules.
    It is still necessary to add them to the Makefile, but that extra work
    should be removed at a future date.
    Signed-off-by: Michael G Schwern <>
  22. Don't lose if $@ gets clobbered.

    In older Perls, sometimes $@ can become unset between the eval and
    checking $@.  Its safer to check the eval directly.
    Signed-off-by: Michael G Schwern <>
  23. Quiet warning if Makefile.PL is run with -w and no --localedir

    Usually it isn't, but its nice if it can be run with warnings on.
    Signed-off-by: Michael G Schwern <>
Something went wrong with that request. Please try again.