summaryrefslogtreecommitdiff
path: root/git-svn.perl
AgeCommit message (Collapse)AuthorFilesLines
2007-01-12use 'init' instead of 'init-db' for shipped docs and toolsLibravatar Nicolas Pitre1-1/+1
While 'init-db' still is and probably will always remain a valid git command for obvious backward compatibility reasons, it would be a good idea to move shipped tools and docs to using 'init' instead. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-07git-svn: pass an unambiguous ref to rev-list when grafting-branchesLibravatar Eric Wong1-1/+1
Some users apparently create local heads with the same basename as the remote branch they're tracking. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-07git-svn: add --prefix= option to multi-initLibravatar Eric Wong1-3/+5
Also, document --{trunk,branches,tags} options while we're documenting multi-init options. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-06git-svn: fix show-ignoreLibravatar Eric Wong1-1/+1
Looks like I broke it in 747fa12cef73b6ca04fffaddaad7326cf546cdea but never noticed. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-04git-svn: make --repack work consistently between fetch and multi-fetchLibravatar Eric Wong1-4/+6
Since fetch reforks itself at most every 1000 revisions, we need to update the counter in the parent process to have a working count if we set our repack interval to be > ~1000 revisions. multi-fetch has always done this correctly because of an extra process; now fetch uses the extra process; as well. While we're at it, only compile the $sha1 regex that checks for repacking once. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-04git-svn: make multi-init less confusingLibravatar Eric Wong1-38/+40
It now requires at least one of the (trunk|branch|tags) arguments (either from the command-line or in .git/config). Also we make sure that anything that is passed as a URL ('help') in David's case is actually a URL. Thanks to David Kågedal for reporting this issue. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-28git-svn: sort multi-init outputLibravatar Eric Wong1-1/+1
This looks a bit more pleasant for users. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-28git-svn: verify_ref() should actually --verifyLibravatar Eric Wong1-1/+2
Not sure how I missed this the first time around... Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-28git-svn: print out the SVN library version in --version, tooLibravatar Eric Wong1-1/+1
This could be useful in finding new problems and helping users debug. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-28git-svn: remove non-delta fetch code pathsLibravatar Eric Wong1-174/+20
We have less code to worry about now. As a bonus, --revision can be used to reliably skip parts of history whenever fetch is run, not just the first time. I'm not sure why anybody would want to skip history in the middle, however... For people (nearly everyone at the moment) without the do_switch() function in their Perl SVN library, the entire tree must be refetched if --follow-parent is used and a parent is found. Future versions of SVN will have a working do_switch() function accessible via Perl. Accessing repositories on the local machine (especially file:// ones) is also slightly slower as a result; but I suspect most git-svn users will be using it to access remote repositories. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-26git-svn: dcommit should diff against the current HEAD after committingLibravatar Eric Wong1-3/+3
This is a followup to dd31da2fdc199132c9fd42023aea5b33672d73cc. Regardless of whether we commit an alternate head, we always diff-tree based on the current HEAD, and rebase against our remote reference as necessary. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22git-svn: enable common fetch/commit options for dcommitLibravatar Eric Wong1-1/+1
dcommit does commits and fetches, so all options used for those should work, too, including --authors-file. Reported missing by Nicolas Vilz. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-16git-svn: rename 'commit' command to 'set-tree'Libravatar Eric Wong1-6/+6
'set-tree' probably accurately describes what the command formerly known as 'commit' does. I'm not entirely sure that 'dcommit' should be renamed to 'commit' just yet... Perhaps 'push' or 'push-changes'? Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-16git-svn: remove support for the svn command-line clientLibravatar Eric Wong1-844/+39
Using the command-line client was great for prototyping and getting something working quickly. Eventually I found time to study the library documentation and add support for using the libraries which are much faster and more flexible when it comes to supporting new features. Note that we require version 1.1 of the SVN libraries, whereas we supported the command-line svn client down to version 1.0. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-15git-svn: convert to using Git.pmLibravatar Eric Wong1-193/+135
Thanks to Git.pm, I've been able to greatly reduce the amount of extra work that needs to be done to manage input/output pipes in Perl. chomp usage has also been greatly reduced, too. All tests (including full-svn-test) still pass, but this has not been tested extensively in the real-world. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-13git-svn: allow both diff.color and color.diffLibravatar Junio C Hamano1-6/+25
The list concensus is to group color related configuration under "color.*" so let's be consistent. Inspired by Andy Parkins's patch to do the same for diff/log family. With fixes from Eric Wong. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-13git-svn: correctly handle "(no author)" when using an authors fileLibravatar Eric Wong1-1/+2
The low-level parts of the SVN library return NULL/undef for author-less revisions, whereas "(no author)" is a (svn) client convention. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-12git-svn: correctly handle packed-refs in refs/remotes/Libravatar Eric Wong1-1/+9
We now use git-rev-parse universally to read refs, instead of our own file_to_s function (which I plan on removing). Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-12git-svn: correctly display fatal() error messagesLibravatar Eric Wong1-1/+1
If I wanted to print $@, I'd pass $@ to fatal(). This looks like a stupid typo on my part. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-12git-svn: allow dcommit to take an alternate headLibravatar Eric Wong1-5/+6
Previously dcommit would unconditionally commit all patches up-to and including the current HEAD. Now if an optional command-line argument is specified, it will only commit up to the specified revision. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-12git-svn: enable logging of information not supported by gitLibravatar Eric Wong1-18/+184
The changes are now tracked in $GIT_DIR/svn/$GIT_SVN_ID/untracked.log Information in the untracked.log include: * the addition and removal of empty directories (changes of these will also warn the user) * file and directory property changes, including (but not limited to) svk:merge and svn:externals * revision properties (revprops) are also tracked * users will be warned of 'absent' file and directories (if users are forbidden access) Fields in entries are separated by spaces; "unsafe" characters are URI-encoded so that each entry takes exactly one line. There is currently no automated parser for dealing with the data in untracked.log, but it should be possible to write one to create empty directories on checkout and manage externals/subprojects. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-08git-svn: use do_switch for --follow-parent if the SVN library supports itLibravatar Eric Wong1-7/+39
do_switch works with the SVN Perl bindings after r22312 in the Subversion trunk. Since no released version of SVN currently supports it; we'll just autodetect it and enable its usage when a user has a recent-enough version of SVN. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-08git-svn: extra error check to ensure we open a file correctlyLibravatar Eric Wong1-0/+3
This may be an issue with repositories imported with commit 27a1a8014b842c0d70fdc91c68dd361ca2dfb34c or later, but before commit dad73c0bb9f33323ec1aacf560a6263f1d85f81a. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-06git-svn: avoid network timeouts for long-running fetchesLibravatar Eric Wong1-0/+1
Long-running fetches run inside children to avoid memory leaks. When we refork, the connection in the parent can be idle for a long time; attempting to reuse it in the next child can result in timeouts. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-02Merge branch 'maint'Libravatar Junio C Hamano1-5/+5
* maint: git-svn: avoid fetching files twice in the same revision
2006-12-02git-svn: avoid fetching files twice in the same revisionLibravatar Eric Wong1-5/+5
SVN is not entirely consistent in returning log information and sometimes returns file information when adding subdirectories, and sometimes it does not (only returning information about the directory that was added). This caused git-svn to occasionally add a file to the list of files to be fetched twice. Now we change the data structure to be hash to avoid repeated fetches. As of now (in master), this only affects repositories fetched without deltas enabled (file://, and when manually overriden with GIT_SVN_DELTA_FETCH=0); so this bug mainly affects users of 1.4.4.1 and maint. Thanks to Florian Weimer for reporting this bug. [jc: backported for maint] Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-28git-svn: fix multi-initLibravatar Eric Wong1-4/+9
After the bugfix to connect to repositories where the user has limited read permissions, multi-init was broken due to our SVN::Ra connection being limited to working in a subdirectory; so we now create a new Ra connection for init-ing branches and another for tags Along with that fix, allow the user to use the command-line option flags for multi-init (--revision being the most notable; but also --no-auth-cache, --config-dir, --username (for passing to SVN), and --shared/--template for passing to git-init-db Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-28git-svn: color support for the log commandLibravatar Eric Wong1-20/+47
* match LESS environment settings to those in pager.c * parse diff.color and pager.color settings in the config file, and pass --color to git-log * --color and --pager= settings are supported Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-28git-svn: fix output reporting from the delta fetcherLibravatar Eric Wong1-20/+15
There was nothing printed in the code originally because I left out a pair of parentheses. Nevertheless, the affected code has been replaced with a more efficient version that respects the -q flag as well as requiring less bandwidth. We save some bandwidth by not requesting changed paths information when calling get_log() since we're using the delta fetcher. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-28git-svn: error out when the SVN connection fails during a fetchLibravatar Eric Wong1-1/+8
finish_report does seem to return a useful value indicating success or failure, so we'll just set a flag when close_edit is called (it is not called on failures, nor is abort_edit) and check the flag before proceeding. Thanks to Pazu for pointing this out. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27git-svn: enable delta transfers during fetches when using SVN:: libsLibravatar Eric Wong1-5/+189
This should drastically reduce bandwidth used for network transfers. This is not enabled for file:// repositories by default because of the increased CPU usage and I/O needed. GIT_SVN_DELTA_FETCH may be set to a true value to enable or false (0) to disable delta transfers regardless of the repository type. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27git-svn: use ~/.subversion config files when using SVN:: librariesLibravatar Eric Wong1-2/+4
This allows users to use HTTP proxy information (among other settings) from ~/.subversion/servers and ~/.subversion/config --config-dir (as before) may be passed to git-svn to override the default choice of '~/.subversion' for the configuration directory. Thanks to tko on #git for pointing this out. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-25git-svn: allow SVN:: lib users to track the root of the repository (again)Libravatar Eric Wong1-2/+6
I broke this again in 747fa12cef73b6ca04fffaddaad7326cf546cdea. Thanks to merlyn for pointing this out to me on IRC. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-24git-svn: exit with status 1 for test failuresLibravatar Eric Wong1-8/+12
Some versions of the SVN libraries cause die() to exit with 255, and 40cf043389ef4cdf3e56e7c4268d6f302e387fa0 tightened up test_expect_failure to reject return values >128. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-24git-svn: correctly access repos when only given partial read permissionsLibravatar Eric Wong1-72/+65
Sometimes users are given only read access to a subtree inside a repository, and git-svn could not read log information (and thus fetch commits) when connecting a session to the root of the repository. We now start an SVN::Ra session with the full URL of what we're tracking, and not the repository root as before. This change was made much easier with a cleanup of repo_path_split() usage as well as improving the accounting of authentication batons. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-24git-svn: handle authentication without relying on cached tokens on diskLibravatar Eric Wong1-8/+148
This is mostly gleaned off SVN::Mirror, with added support for --no-auth-cache and --config-dir. Even with this patch, git-svn does not yet support repositories where the user only has partial read permissions. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23git-svn: preserve uncommitted changes after dcommitLibravatar Eric Wong1-1/+1
Using dcommit could cause the user to lose uncommitted changes during the reset --hard operation, so change it to reset --mixed. If dcommit chooses the rebase path, then git-rebase will already error out when local changes are made. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23git-svn: correctly handle revision 0 in SVN repositoriesLibravatar Eric Wong1-4/+10
some SVN repositories have a revision 0 (committed by no author and no date) when created; so when we need to ensure that we check any revision variables are defined, and not just non-zero. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23git-svn: error out from dcommit on a parent-less commitLibravatar Eric Wong1-0/+7
dcommit would unconditionally append "~1" to a commit in order to generate a diff. Now we generate a meaningful error message if we try to generate an impossible diff. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-09git-svn: fix dcommit losing changes when out-of-date from svnLibravatar Eric Wong1-3/+26
There was a bug in dcommit (and commit-diff) which caused deltas to be generated against the latest version of the changed file in a repository, and not the revision we are diffing (the tree) against locally. This bug can cause recent changes to the svn repository to be silently clobbered by git-svn if our repository is out-of-date. Thanks to Steven Grimm for noticing the bug. The (few) people using the commit-diff command are now required to use the -r/--revision argument. dcommit usage is unchanged. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-09git-svn: don't die on rebuild when --upgrade is specifiedLibravatar Eric Wong1-1/+1
--copy-remote and --upgrade are rarely (never?) used together, so if --copy-remote is specified, that means the user really wanted to copy the remote ref, and we should fail if that fails. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-09git-svn: avoid printing filenames of files we're not trackingLibravatar Eric Wong1-5/+4
This is purely an aesthetic change, we already skip importing of files that don't affect the subdirectory we import. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-24git-svn: fix symlink-to-file changes when using command-line svn 1.4.0Libravatar Eric Wong1-3/+6
I incorrectly thought this was hopelessly broken in svn 1.4.0, but now it's just broken in that the old method didn't work. It looks like svn propdel and svn propset must be used now and the (imho) more obvious svn rm --force && svn add no longer works. "make -C t full-svn-test" should now work. Signed-off-by: Eric Wong <normalperson@yhbt.net> Acked-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-14git-svn: reduce memory usage for large commitsLibravatar Eric Wong1-2/+4
apply_textdelta and send_stream can use a separate pool from the rest of the editor interface, so we'll use a separate SVN::Pool for them and clear the pool after each file is sent to SVN. This drastically reduces memory usage per-changeset committed, and makes large commits (and initial imports) of several thousand files possible. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-14git-svn: fix commits over svn+ssh://Libravatar Eric Wong1-2/+2
Once a get_commit_editor has been called from an SVN session, RA layer operations are not allowed (well, unless you're using file:// or http(s)://). So we'll pass an alternate SVN::Ra object to our editor object for running 'check-path'. This should fix commits over svnserve (svn:// without ssh, too). Closes Debian bug #392702, thanks to Pierre Habouzit for reporting the bug. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-11git-svn: add a message encouraging use of SVN::* librariesLibravatar Eric Wong1-0/+14
I'm using svn 1.4.0-4 in Debian unstable and apparently there's a regression on the SVN side that prevents a symlink from becoming a regular file (which git supports, of course). It's not a noticeable regression for most people, but this broke the full-svn-tests target in t/Makefile for me. The SVN::* Perl libraries seem to have matured and improved over the past year, and git-svn has supported them for several months now, so with that I encourage all users to start using the SVN::* Perl libraries with git-svn. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-11git-svn: -h(elp) message formatting fixesLibravatar Eric Wong1-2/+2
'graft-branches' is slightly longer than the rest of the commands, so the text was squished together in the formatted output. This patch just adds some more whitespace to make the text look more pleasant. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-11git-svn: log command fixesLibravatar Eric Wong1-7/+25
Change the --verbose flag to more closely match svn. I was somehow under the impression that --summary included --raw diff output, but I was wrong. We now pass -r --raw --name-status as arguments if passed -v/--verbose. -r (recursive) is passed by default, since users usually want it, and accepting it causes difficulty with the -r<revision> option used by svn users. A --non-recursive switch has been added to disable this. Of course, --summary, --raw, -p and any other git-log options can still be passed directly (without --name-status). Also, several warnings about referencing undefined variables have been fixed. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-11git-svn: multi-init saves and reuses --tags and --branches argumentsLibravatar Eric Wong1-4/+14
This should make it much easier to track newly added tags and branches. Re-running multi-init without command-line arguments should now detect new-tags and branches. --trunk shouldn't change often, but running multi-init on it is now idempotent. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-26git-svn: Fix fetch --no-ignore-externals with GIT_SVN_NO_LIB=1Libravatar Sergey Vlasov1-0/+1
When using Subversion 1.3.1 without Perl bindings (GIT_SVN_NO_LIB=1), "git-svn fetch --no-ignore-externals" fails with errors like: Tree (.../.git/svn/git-svn/tree) is not clean: X directory_with_external In this case the 'X' lines in the "svn status" output are not a sign of unclean tree, and therefore should be ignored. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>