Commit graph

388 commits

Author SHA1 Message Date
Simon Arlott 49750f3076 git-svn: add a double quiet option to hide git commits
People may expect/prefer -q to still show git commits,
so this change allows a second -q to hide them.

Signed-off-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-03-30 23:51:20 -07:00
Simon Arlott 18d5cf908f git-svn: don't output git commits in quiet mode
Ideally only errors should be output in this mode so fetch
can be run from cron and normally produce no output. Without
this change it would output a single line on each git commit,
e.g.
r1909 = 32ef87860662526d4a62f903949ed21e0341079e (u2_10_12_branch)

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-03-29 15:42:00 -07:00
Eric Wong 4f821012c3 git-svn: fix ls-tree usage with dash-prefixed paths
To find the blob object name given a tree and pathname, we were
incorrectly calling "git ls-tree" with a "--" argument followed
by the pathname of the file we wanted to get.

  git ls-tree <TREE> -- --dashed/path/name.c

Unlike many command-line interfaces, the "--" alone does not
symbolize the end of non-option arguments on the command-line.

ls-tree interprets the "--" as a prefix to match against, thus
the entire contents of the --dashed/* hierarchy would be
returned because the "--" matches "--dashed" and every path
under it.

Thanks to Anton Gyllenberg for pointing me toward the
Twisted repository as a real-world example of this case.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-03-28 23:00:05 -07:00
Michael Lai 9162b8640b git-svn: support intermediate paths when matching tags/branches
For repositories laid out like the following:

[svn-remote "svn"]
      url = http://foo.com/svn/repos/bar
      fetch = myproject/trunk:refs/remotes/trunk
      branches = bar/myproject/branches/*:refs/remotes/*
      tags = bar/myproject/tags/*:refs/remotes/tags/*

The "bar" component above is considered the intermediate path
and was not handled correctly.

Signed-off-by: Michael Lai <myllai@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-03-09 14:52:12 -07:00
Ben Walton 736e619a1b git-svn - return original format_svn_date semantics
When %z was removed from the strftime call and subsituted with a
local gmt offset calculation, time() was no longer the default for
all time functions as it was with the previous localtime(shift).
This is now corrected so that format_svn_time behaves as it used to.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-27 21:53:43 -08:00
Eric Wong 48679e5c2d git-svn: disable broken symlink workaround by default
Even though this will break things for some extremely rare repositories
used by broken Windows clients, it's probably not worth enabling this by
default as it has negatively affected many more users than it has helped
from what we've seen so far.

The extremely rare repositories that have broken symlinks in them will be
silently corrupted in import; but users can still reenable this option and
restart the import.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-27 21:53:09 -08:00
Ben Walton e871784132 git-svn fix to avoid using strftime %z
%z isn't available on all platforms in the date formatting
routines.  Provide a workalike capability that should be
more portable.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-02-24 13:45:36 -08:00
Peter Oberndorfer 0df84059d4 git-svn: read the dcommit url from the config file on a per remote basis
The commit url for dcommit is determined in the following order:
commandline option --commit-url
svn.commiturl
svn-remote.<name>.commiturl
svn-remote.<name>.url

Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-02-23 13:50:24 -08:00
Eric Wong 83c2fcff21 git-svn: fix delete+add branch tracking with empty files
Original bug report and test case by Björn Steinbrink.

Björn Steinbrink <B.Steinbrink@gmx.de> wrote:
> Hi Eric,
>
> seems that the empty symlink stuff gets confused about which revision to
> use when looking for the parent's file.
>
> r3 = f1a6fcf6b0a1c4a373d0b2b65a3d70700084f361 (tags/1.0.1)
> Found possible branch point: file:///home/doener/h/svn/tags/1.0 => file:///home/doener/h/svn/branches/1.0, 4
> Found branch parent: (1.0) 63ae640ba01014ecbb3df590999ed1fa5914545b
> Following parent with do_switch
> Successfully followed parent
> r5 = 26fcfef5bcced97ab74faf1af7341a2ae0d272aa (1.0)
> Found possible branch point: file:///home/doener/h/svn/branches/1.0 => file:///home/doener/h/svn/tags/1.0.1, 5
> Found branch parent: (tags/1.0.1) 26fcfef5bcced97ab74faf1af7341a2ae0d272aa
> Following parent with do_switch
> Scanning for empty symlinks, this may take a while if you have many empty files
> You may disable this with `git config svn.brokenSymlinkWorkaround false'.
> This may be done in a different terminal without restarting git svn
> Filesystem has no item: File not found: revision 3, path '/branches/1.0/file' at /usr/local/libexec/git-core/git-svn line 3318
>
> Note how it tries to look at revision 3 instead of revision 5 (which it
> correctly detected as the parent). The import succeeds when
> svn.brokenSymlinkWorkaround is set to false. Testcase below.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-02-22 20:31:08 -08:00
Brian Gernhardt 7d9fd459f1 git-svn: Create leading directories in create-ignore
Since SVN tracks empty directories and git does not, we can not assume
that the directory exists when creating .gitignore files.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-02-22 20:30:58 -08:00
Junio C Hamano b94ead7594 git-svn: fix parsing of timestamp obtained from svn
Ward Wouts reports that git-svn barfed like this:

    Unable to parse date: 2004-03-09T09:44:33.Z at /usr/bin/git-svn line 3995

The parse_svn_date sub expects there always are one or more digits after
the decimal point to record fractional seconds, but this example does not
and results in a failure like this.

The fix is based on the original fix by the reporter, further cleaned up.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-02-18 10:48:01 -08:00
Dévai Tamás 1b7e543a6e git-svn: Fix for rewriteRoot URL containing username.
If the new svn root URL given with the svn-remote.<repo>.rewriteRoot config option
(or by the --rewrite-root option to 'git svn init') contains a username
(such as 'svn+ssh://username@example.com/repo'), find_by_url() cannot find
the repository URL, because the URL contained in the commit message does have
the username removed.

Signed-off-by: Dévai Tamás <devait@mailbox.sk>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-15 18:04:48 -08:00
Eric Wong 8841b37f2f git-svn: fix broken symlink workaround when switching branches
Thanks to Anton Gyllenberg <anton@iki.fi> for the bug report
(and testcase in the following commit):
> Commit dbc6c74d08 "git-svn:
> handle empty files marked as symlinks in SVN" caused a
> regression in an unusual case where a branch has been created
> in SVN, later deleted and then created again from another
> branch point and the original branch point had empty files not
> in the new branch. In some cases git svn fetch will then fail
> while trying to fetch the empty file from the wrong SVN
> revision.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-02-11 02:02:04 -08:00
Deskin Miller 99366565f1 git-svn: Print revision while searching for earliest use of path
When initializing a git-svn repository from a Subversion repoository,
it is common to be interested in a path which did not exist in the
initial commit to Subversion.  In a large repository, the initial fetch
may take some looking for the earliest existence of the path time while
the user receives no additional feedback.  Print the highest revision
number scanned thus far to let the user know something is still
happening.

Signed-off-by: Deskin Miller <deskinm@umich.edu>
2009-02-11 02:00:42 -08:00
Sam Vilain 8e3f9b17a5 git-svn: abstract out a block into new method other_gs()
We will be adding a more places that need to find git revisions
corresponding to new parents, so abstract out this section into a new
method.

Signed-off-by: Yuval Kogman <nothingmuch@woobling.org>
Signed-off-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>

[ew: minor formatting changes]
2009-02-11 02:00:42 -08:00
Eric Wong 4c58a7111d git-svn: allow disabling expensive broken symlink checks
Since dbc6c74d08, git-svn has had
an expensive check for broken symlinks that exist in some
repositories.  This leads to a heavy performance hit on
repositories with many empty blobs that are not supposed to be
symlinks.

The workaround is enabled by default; and may be disabled via:

  git config svn.brokenSymlinkWorkaround false

Reported by Markus Heidelberg.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-02-11 02:00:42 -08:00
Vitaly \"_Vi\" Shukela edc662f929 git-svn: add --ignore-paths option for fetching
This will be useful when somebody want to checkout something partially from
repository with some non-standart layout or exclude some files from it.
Example: repository has structure /module-{a,b,c}/{trunk,branches,tags}/...
Modules are interdependent, and you want it to be single repostory (to commit
to all modules simultaneously and view complete history), but do not want
branches and tags be checked out into working copy.
Other use case is excluding some large blobs.

The quirk for now is that user must specify this option every fetch/rebase;
in other case he may get extra files or "file not found" errors. It may be
will be resolved by adding regular expression to .git/config into
[svn-remote ...] to make it persistent.

Signed-off-by: Vitaly "_Vi" Shukela <public_vi@tut.by>
Acked-by: Eric Wong <normalperson@yhbt.net>

[ew: replaced 4-space indent with tabs]
[ew: prefixed $ignore_regex with an underscore to be consistent
     with other globals in git-svn]
[ew: rearranged functions to minimize diff and removed prototype
     usage to be consistent with the rest of git-svn (and other
     Perl code in git (and they're ugly to me)]
2009-01-25 17:01:47 -08:00
Eric Wong bf8a40b89e git-svn: fix memory leak when checking for empty symlinks
By enforcing SVN::Pool usage when calling get_file once again.

This regression was introduced with the reintroduction of
SVN::Ra::get_file() usage in
dbc6c74d08

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-01-25 17:01:47 -08:00
Marcel Koeppen 22ba47f544 git-svn: Show UUID in svn info for added directories with svn 1.5.5
In svn 1.5.5 the output of "svn info" for added directories was changed
and now shows the repository UUID. This patch implements the same
behavior for "git svn info" and makes t9119-git-svn-info.17 pass if
svn 1.5.5 is used.

Signed-off-by: Marcel Koeppen <git-dev@marzelpan.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-01-18 19:51:44 -08:00
Eric Wong b03a71a660 git-svn: avoid importing nested git repos
Some SVN repositories contain git repositories within them
(hopefully accidentally checked in).  Since git refuses to track
nested ".git" repositories, this can be a problem when fetching
updates from SVN.

Thanks to Morgan Christiansson for the report and testing.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-01-18 18:39:57 -08:00
Eric Wong 1ef626b4b6 git-svn: fix SVN 1.1.x compatibility
The get_log() function in the Perl SVN API introduced the limit
parameter in 1.2.0.  However, this got discarded in our SVN::Ra
compatibility layer when used with SVN 1.1.x.  We now emulate
the limit functionality in older SVN versions by preventing the
original callback from being called if the given limit has been
reached.  This emulation is less bandwidth efficient, but SVN
1.1.x is becoming rarer now.

Additionally, the --limit parameter in svn(1) uses the
aforementioned get_log() functionality change in SVN 1.2.x.
t9129 no longer depends on --limit to work and instead uses
Perl to parse out the commit message.

Thanks to Tom G. Christensen for the bug report.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-01-18 15:38:28 -08:00
Pete Harlan e82f0d73f0 git-svn: Add --localtime option to "fetch"
By default git-svn stores timestamps of fetched commits in
Subversion's UTC format.  Passing --localtime to fetch will convert
them to the timezone of the server on which git-svn is run.

This makes the timestamps of a resulting "git log" agree with what
"svn log" shows for the same repository.

Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-01-18 15:38:28 -08:00
Eric Wong baf5fa8a7f git-svn: better attempt to handle broken symlink updates
This is a followup to 7fc35e0e94,
(workaround a for broken symlinks in SVN).

Since broken SVN clients can commit svn:special files without
the magic "link " prefix, this can affect delta application
when we update the broken svn:special file.  So now we fall
back and retry the delta application on symlinks if having
a "link " prefix fails.

Our behavior differs from svn(1) (v1.5.1) slightly:

  When a svn:special file is created w/o a "link " prefix, svn
  will create a regular file (mode 100644 to git) with the
  contents of the blob as-is.

  Our behavior is to continue creating the symlink (mode 120000
  to git) with the contents of the blob as-is.  While this
  differs from current svn(1) behavior, this is easier and more
  efficient to implement (and the correctness of the svn(1) is
  debatable, since it's a workaround for a bug in the first
  place).

More information on this SVN bug is described here:
  http://subversion.tigris.org/issues/show_bug.cgi?id=2692

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-01-18 15:38:28 -08:00
Eric Wong dbc6c74d08 git-svn: handle empty files marked as symlinks in SVN
Broken SVN clients generate empty files with the svn:special set
to '*'.  This attempts to denote a symlink pointing to a file
with an empty path (""), which cannot be generated on a POSIX
system.

Thus, we mimic the behavior of svn(1) and create a zero-byte
file in our tree.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-01-18 15:38:27 -08:00
Johannes Schindelin 8befc50c49 Get rid of the last remnants of GIT_CONFIG_LOCAL
In dc871831(Only use GIT_CONFIG in "git config", not other programs),
GIT_CONFIG_LOCAL was rested in peace, in favor of not reading
/etc/gitconfig and $HOME/.gitconfig at all when GIT_CONFIG is set.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-14 16:43:39 -08:00
Junio C Hamano 5363d0744e Merge branch 'maint'
* maint:
  work around Python warnings from AsciiDoc
  git-svn: Make following parents atomic
2008-12-09 22:41:27 -08:00
Deskin Miller 553589f782 git-svn: Make following parents atomic
find_parent_branch generates branch@rev type branches when one has to
look back through SVN history to properly get the history for a branch
copied from somewhere not already being tracked by git-svn.  If in the
process of fetching this history, git-svn is interrupted, then when one
fetches again, it will use whatever was last fetched as the parent
commit and fail to fetch any more history which it didn't get to before
being terminated.  This is especially troubling in that different
git-svn copies of the same SVN repository can end up with different
commit sha1s, incorrectly showing the history as divergent and
precluding easy collaboration using git push and fetch.

To fix this, when we initialise the Git::SVN object $gs to search for
and perhaps fetch history, we check if there are any commits in SVN in
the range between the current revision $gs is at, and the top revision
for which we were asked to fill history.  If there are commits we're
missing in that range, we continue the fetch from the current revision
to the top, properly getting all history before using it as the parent
for the branch we're trying to create.

Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-08 16:29:34 -08:00
Deskin Miller a0fbc87cff git-svn: Make branch use correct svn-remote
The 'branch' subcommand incorrectly had the svn-remote to use hardcoded
as 'svn', the default remote name.  This meant that branches derived
from other svn-remotes would try to use the branch and tag configuration
for the 'svn' remote, potentially copying would-be branches to the wrong
place in SVN, into the branch namespace for another project.

Fix this by using the remote name extracted from the svn info for the
specified git ref.  Add a testcase for this behaviour.

[jc: squashed in a fix to test from Michael J Gruber for older svn (1.4)]

Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-03 01:54:24 -08:00
Marten Svanfeldt (dev) 1b3069a753 git-svn: Update git-svn to use the ability to place temporary files within repository directory
This fixes git-svn within msys where Perl will provide temporary files with path
such as /tmp while the git suit expects native Windows paths.

Signed-off-by: Marten Svanfeldt <developer@svanfeldt.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2008-11-13 22:42:45 -08:00
Deskin Miller fe4003f630 git-svn: proper detection of bare repositories
When in a bare repository (or .git, for that matter), git-svn would fail
to initialise properly, since git rev-parse --show-cdup would not output
anything.  However, git rev-parse --show-cdup actually returns an error
code if it's really not in a git directory.

Fix the issue by checking for an explicit error from git rev-parse, and
setting $git_dir appropriately if instead it just does not output.

Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
2008-11-13 22:33:59 -08:00
Eric Wong 16fc08e2d8 git-svn: respect i18n.commitencoding config
SVN itself always stores log messages in the repository as
UTF-8.  git always stores/retrieves everything as raw binary
data with no transformations whatsoever.

To interact with SVN, we need to encode log messages as UTF-8
before sending them to SVN, as SVN cannot do it for us.  When
retrieving log messages from SVN, we also need to (attempt to)
reencode the UTF-8 log message back to the user-specified commit
encoding.

Note, handling i18n.logoutputencoding for "git svn log" also
needs to be done in a future change.

Also, this change only deals with the encoding of commit
messages and nothing else (path names, blob content, ...).

In-Reply-To: <8b168cfb0810282014r789ac01dnec51824de1078f0@mail.gmail.com>
James North <tocapicha@gmail.com> wrote:
> Hi,
>
> I'm using git-svn on a system with ISO-8859-1 encoding. The problem is
> when I try to use "git svn dcommit" to send changes to a remote svn
> (also ISO-8859-1).
>
> Seems like git-svn is sending commit messages with utf-8 (just a
> guessing...) and they look bad on the remote svn log. E.g. "Ca?\241a
> de cami?\243n"
>
> I have tried using i18n.commitencoding=ISO-8859-1 as suggested by the
> warning when doing "git svn dcommit" but messages still are sent with
> wrong encoding.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-11-13 22:33:58 -08:00
Eric Wong 6a004d3f2e git-svn: don't escape tilde ('~') for http(s) URLs
Thanks to Jose Carlos Garcia Sogo and Björn Steinbrink for the
bug report.

On 2008.10.18 23:39:19 +0200, Björn Steinbrink wrote:
> Hi,
>
> Jose Carlos Garcia Sogo reported on #git that a git-svn clone of this
> svn repo fails for him:
> https://sucs.org/~welshbyte/svn/backuptool/trunk
>
> I can reproduce that here with:
> git-svn version 1.6.0.2.541.g46dc1.dirty (svn 1.5.1)
>
> The error message I get is:
> Apache got a malformed URI: Unusable URI: it does not refer to this
> repository at /usr/local/libexec/git-core/git-svn line 4057
>
> strace revealed that git-svn url-encodes ~ while svn does not do that.
>
> For svn we have:
> write(5, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\">
> <S:src-path>https://sucs.org/~welshbyte/svn/backuptool/trunk</S:src-path>...
>
> While git-svn shows:
> write(7, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\">
> <S:src-path>https://sucs.org/%7Ewelshbyte/svn/backuptool/trunk</S:src-path>...

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-11-13 22:33:58 -08:00
Junio C Hamano 933bb3ae5e Merge branch 'maint'
* maint:
  git-svn: change dashed git-commit-tree to git commit-tree
  Documentation: clarify information about 'ident' attribute
  bash completion: add doubledash to "git show"
  Use test-chmtime -v instead of perl in t5000 to get mtime of a file
  Add --verbose|-v to test-chmtime
  asciidoc: add minor workaround to add an empty line after code blocks
  Plug a memleak in builtin-revert
  Add file delete/create info when we overflow rename_limit
  Install git-cvsserver in $(bindir)
  Install git-shell in bindir, too
2008-10-31 01:42:58 -07:00
Deskin Miller e855bfc040 git-svn: change dashed git-commit-tree to git commit-tree
Signed-off-by: Deskin Miller <deskinm@umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-31 01:22:48 -07:00
Junio C Hamano 304d058370 Merge branch 'maint'
* maint:
  add -p: warn if only binary changes present
  git-archive: work in bare repos
  git-svn: change dashed git-config to git config
2008-10-26 16:21:08 -07:00
Deskin Miller 225f1d0c6a git-svn: change dashed git-config to git config
Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-24 16:20:30 -07:00
Florian Ragwitz 5de70efbd9 Add git-svn branch to allow branch creation in SVN repositories
[ew: fixed a warning to stderr causing t9108 to fail]

Signed-off-by: Florian Ragwitz <rafl@debian.org>
Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-06 09:00:55 -07:00
Shawn O. Pearce 8b745e3ffd Merge branch 'maint'
* maint:
  git-svn: call 'fatal' correctly in set-tree
  Replace svn.foo.org with svn.example.com in git-svn docs (RFC 2606)
  t0024: add executable permission
2008-09-30 14:14:09 -07:00
Luc Heinrich 0a1a1c8615 git-svn: call 'fatal' correctly in set-tree
When doing a set-tree and there is no revision to commit to, the following unrelated error message is displayed: "Undefined subroutine &Git::SVN::fatal called at /opt/local/libexec/git-core/git-svn line 2575." The following patch fixes the problem and allows the real error message to be shown.

Signed-off-by: Luc Heinrich <luc@honk-honk.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 13:58:59 -07:00
Deskin Miller 2beec89733 git-svn: do a partial rebuild if rev_map is out-of-date
Suppose you're using git-svn to work with a certain SVN repository.
Since you don't like 'git-svn fetch' to take forever, and you don't want
to accidentally interrupt it and end up corrupting your repository, you
set up a remote Git repository to mirror the SVN repository, which does
its own 'git-svn fetch' on a cronjob; now you can 'git-fetch' from the
Git mirror into your local repository, and still dcommit to SVN when you
have changes to push.

After you do this, though, git-svn will get very confused if you ever
try to do 'git-svn fetch' in your local repository again, since its
rev_map will differ from the branch's head, and it will be unable to
fetch new commits from SVN because of the metadata conflict.  But all
the necessary metadata are there in the Git commit message; git-svn
already knows how to rebuild rev_map files that get blown away, by
using the metadata.

This patch teaches git-svn do a partial rebuild of the rev_map to
match the true state of the branch, if it ever is used to fetch again.

This will only work for projects not using either noMetadata or
useSvmProps configuration options; if you are using these options,
git-svn will fall back to the previous behaviour.

Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-21 23:51:13 -07:00
Junio C Hamano 3791f77c28 Merge branch 'maint'
* maint:
  sha1_file: link() returns -1 on failure, not errno
  Make git archive respect core.autocrlf when creating zip format archives
  Add new test to demonstrate git archive core.autocrlf inconsistency
  gitweb: avoid warnings for commits without body
  Clarified gitattributes documentation regarding custom hunk header.
  git-svn: fix handling of even funkier branch names
  git-svn: Always create a new RA when calling do_switch for svn://
  git-svn: factor out svnserve test code for later use
  diff/diff-files: do not use --cc too aggressively
2008-09-18 20:30:12 -07:00
Eric Wong 61aeeefd29 git-svn: fix handling of even funkier branch names
Apparently do_switch() tolerates the lack of escaping in less
funky branch names.  For the really strange and scary ones, we
need to escape them properly.  It strangely maintains compatible
with the existing handling of branch names with spaces and
exclamation marks.

Reported-by: m.skoric@web.de ($gmane/94677)
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-18 19:27:16 -07:00
Alec Berryman ad0a82bae0 git-svn: Always create a new RA when calling do_switch for svn://
Not doing so caused the "Malformed network data" error when a directoy
was deleted and replaced with a copy from an older version.

Signed-off-by: Alec Berryman <alec@thened.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 19:21:40 -07:00
Junio C Hamano b281eea75f Merge branch 'maint'
* maint:
  Update draft release notes for 1.6.0.2
  Use compatibility regex library for OSX/Darwin
  git-svn: Fixes my() parameter list syntax error in pre-5.8 Perl
  Git.pm: Use File::Temp->tempfile instead of ->new
  t7501: always use test_cmp instead of diff

Conflicts:
	Makefile
2008-09-10 13:56:20 -07:00
Marcus Griep 971e628384 git-svn: Fixes my() parameter list syntax error in pre-5.8 Perl
Signed-off-by: Marcus Griep <marcus@griep.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10 11:47:06 -07:00
Marcus Griep 836ff95df6 Git.pm: Use File::Temp->tempfile instead of ->new
Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()
interface introduced in 0.14, as pointed out by Tom G. Christensen.

This modifies Git.pm to use the more established tempfile() interface
and updates 'git svn' to match.

Signed-off-by: Marcus Griep <marcus@griep.us>
Acked-by: Eric Wong <normalperson@yhbt.net>
Tested-by: Tom G. Christensen <tgc@statsbiblioteket.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10 11:45:22 -07:00
Eric Wong f4392df485 git-svn: fix handling of even funkier branch names
Apparently do_switch() tolerates the lack of escaping in less
funky branch names.  For the really strange and scary ones, we
need to escape them properly.  It strangely maintains compatible
with the existing handling of branch names with spaces and
exclamation marks.

Reported-by: m.skoric@web.de ($gmane/94677)
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-06 21:00:28 -07:00
Paul Talacko 7c4d0219cf git-svn: set auto_props when renaming files
Patch-by: Paul Talacko <gnuruandstuff@yahoo.co.uk>:
<http://article.gmane.org/gmane.comp.version-control.git/95006>
> Hello,
>
> There's an issue in git-svn as autoprops are not applied to
> renamed files, only to added files.
>
> This patch fixes the bug.

[ew: added test case]
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-06 18:58:59 -07:00
Thomas Rast 2cf3e3ac02 git-svn: match SVN 1.5 behaviour of info' on unknown item
Previously 'git svn info unknown-file' only announced its failure (in
the SVN 1.4 style, "not a versioned resource"), and exited
successfully.

It is desirable to actually exit with failure, so change the code to
exit(1) under this condition.  Since that is already halfway SVN 1.5
compatibility, also change the error output to match 1.5.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05 16:58:39 -07:00
Thomas Rast 05427b91f0 git svn info: always quote URLs in 'info' output
Changes 'git svn info' to always URL-escape the 'URL' and 'Repository'
fields and --url output, like SVN (at least 1.5) does.

Note that reusing the escape_url() further down in Git::SVN::Ra is not
possible because it only triggers for http(s) URLs.  I did not know
whether extending it to all schemes would break SVN access anywhere,
so I made a new one that quotes in all schemes.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05 16:58:39 -07:00