summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2007-02-23git-svn: reintroduce using a single get_log() to fetchLibravatar Eric Wong1-54/+49
We'll need to rely on path matching to handle wildcard support for branches and tags. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: prepare multi-init for wildcard supportLibravatar Eric Wong2-13/+131
Update the tests since we no longer write so many things to the config. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: just name the default svn-remote "svn" instead of "git-svn"Libravatar Eric Wong4-16/+16
It can be confusing and redundant, since historically the default remote ref (not remote itself) has been "git-svn", too. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: avoid extra get_log calls when refspecs are added for fetchingLibravatar Eric Wong1-1/+6
Since fetch_loop_common starts from the lowest revision number in a group of Git::SVN objects; we want to avoid refetching get_log for current users for things we've already cut it. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: get rid of revisions_eq check for --follow-parentLibravatar Eric Wong1-11/+1
This was originally needed before we used the delta fetcher and had a less-clean follow-parent implementation that could leave holes in the history. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: migrations default to [svn-remote "git-svn"]Libravatar Eric Wong1-1/+4
It looks better (like [remote "origin"]) instead of whatever refname came up first in our directory traversal. Of course --remote= overrides this. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: save paths to tags/branches with for future reuseLibravatar Eric Wong1-1/+12
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: don't write to the config file from --follow-parentLibravatar Eric Wong2-10/+12
Having 'fetch' entries in the config file created from --follow-parent is wasteful because it can cause *future* of invocations to follow revisions we were never interested in in the first place. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: use sys* IO functions for reading rev_dbLibravatar Eric Wong1-15/+9
Using buffered IO for reading 40-41 bytes at a time isn't very efficient. Buffering writes for a short duration is alright since we close() right away and buffers will be flushed. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: avoid redundant get_log calls between invocationsLibravatar Eric Wong1-7/+23
Prefill .rev_db to the maximum revision we tried to fetch; and take advantage of that so we can avoid using get_log() on ranges we've already seen (and have deemed uninteresting). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: do our best to ensure that our ref and rev_db are consistentLibravatar Eric Wong1-4/+36
Defer any signals that cause termination while they are updating; and put the update-ref call as close to the rename() as possible. Also, make things extra-safe (but slower) for people using --no-metadata since they can't rely on .rev_db being rebuilt if it's clobbered (well, I'm calling update-ref with the -m flag for reflogs, we don't yet have a way to rebuild .rev_db from reflogs. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: re-enable repacking flagsLibravatar Eric Wong1-4/+22
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: avoid a huge memory spike with high-numbered revisionsLibravatar Eric Wong1-2/+3
Passing very large strings as arguments is bad for memory usage as it never seems to get freed in Perl. The .rev_db format is already not optimized for projects with sparse history. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: make (multi-)fetch safer but slowerLibravatar Eric Wong1-38/+37
get_log with explicit paths is the safest way to get revisions that change a particular path we're interested in. Unfortunately that means we still have to run get_log multiple times for each path we're interested in, and even more if a path gets deleted. The first argument of get_log() is an array reference, but we shouldn't use more than one element in that array ref because the non-existence of _one_ of those paths for a particular range would cause an error for all paths in that range, so yes, we need multiple get_log calls to be on the safe side... Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: gracefully handle --follow-parent failuresLibravatar Eric Wong1-0/+3
We don't always know that a path will exist at a particular revision. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: reinstate --no-metadata, add --svn-remote=, variable cleanupsLibravatar Eric Wong2-24/+24
--svn-remote allows the default remote name to be overridden (useful for tracking multiple SVN repositories). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: fix several fetch bugs related to repeated invocationsLibravatar Eric Wong2-15/+43
We no longer delete the top-level directory even if it got deleted from the upstream repository. In gs_do_update; we double-check that the path we're tracking exists at both endpoints before proceeding. We have also added additional protection against fetching revisions out-of-order. To simplify our internal interfaces, I've disabled passing the 'recursive' flag to the gs_do_{switch,update} wrapper functions since we always want it in git-svn. We also pass the entire Git::SVN object rather than just the path because it helped me debug. When printing progress, the refname is printed out to make it less confusing when multi-fetch is running. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: remove the 'rebuild' command and make the functionality automaticLibravatar Eric Wong2-94/+39
Since refs/remotes/* are not automatically cloned, we expect the user to be capable of copying those references themselves anyways. Also removed the documentation for --ignore-nodate while we're at it; it has also been made automatic. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: fetch tracks initial change with --follow-parentLibravatar Eric Wong2-4/+27
We were still skipping path information from get_log if we are tracking /r9270/drunk/subversion/bindings/..., but got something like this in the log: A /r9270/drunk (from /r9270/trunk:14) Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: don't rely on do_switch + reparenting with svn(+ssh)://Libravatar Eric Wong1-15/+27
I can't seem to figure out what I or the SVN libraries are doing wrong, but it appears to be related to reparent and probably some global structure that gets reset if multiple SVN connections are being used. So now, in order to use do_switch; we'll open a new connection to the repository with the complete URL; but we can't seem to ever use an existing Ra object after another one has been created... Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: reinstate the default SVN error handler after using get_logLibravatar Eric Wong1-4/+9
We don't need our own error handler for other operations. Also add a message about the successfully do_switch or do_update in follow-parent for debugging do_switch failures with svn:// and svn+ssh:// connections. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: just use Digest::MD5 instead of requiring itLibravatar Eric Wong1-2/+2
Historically, git-svn did not always use Digest::MD5 because it did not use the SVN::Delta::Editor interfaces. Nowadays it does, and the requires make strace more noisy. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: cleanup: move editor-specific variables into the editor namespaceLibravatar Eric Wong1-25/+12
Also removed some unused/redundant functions. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: stop using path names as refnames with --follow-parentLibravatar Eric Wong2-4/+8
Using path names as refnames breaks horribly if a user is tracking one large, toplevel directory, and a lower-level directory is followed from another project is a parent of another ref, as it will cause refnames such as: 'refs/remotes/trunk/path/to/stuff', which will conflict with a refname of 'refs/remotes/trunk'. Now we just append @$revno to the end of it the current refname. And if we have followed back to a grandparent, then we'll strip any existing '@$parent_revno' strings before appending our own '@$revno' string to it. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: correctly handle do_{switch,update} in deep directoriesLibravatar Eric Wong2-8/+69
The do_update or do_switch functions in SVN only allow for a single path component; so 'path/to/deep/dir' would be interpreted as 'path'. SVN 1.4.x has a reparent function that can let us change the session to use a higher-level root of the repository, so we can use that for do_switch (which still doesn't seem to work in SVN 1.4.3 (a fix was attempted, but they missed the rest of the typemap changes needed in trunk...)). On the do_update side, we can use set_path on higher level directories and set them to a newer revision so they don't get updated. We can't do this with do_switch, either, because the relative path we're tracking can change (directory moving into a child of itself). Because of these changes, we need to double check that our Fetch editor is correctly performing stripping on any prefixed paths from update, otherwise we'll just die() because that would be a bug. Added a test case which helped me notice and fix problems with do_switch, too. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: correctly track diff-less copies with do_switchLibravatar Eric Wong1-1/+3
Also, this should allow for the tracking of new, but empty directories where we would want to see the log message. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: allow multi-fetch to fetch things chronologicallyLibravatar Eric Wong1-91/+120
Since single fetching is a special case of multi-fetch, share code with it and the fetch loop into Git::SVN::Ra since it uses a single Ra connection and multiple Git::SVN objects. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: cleanup remove unused functionLibravatar Eric Wong1-25/+8
Also move tz_to_s_offset into Git::SVN::Log since that's the only place it's used now. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: simplify usage of the SVN::Git::Editor interfaceLibravatar Eric Wong1-142/+139
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: avoid an extra svn_ra connection during commitsLibravatar Eric Wong1-82/+123
Before, we needed a separate svn_ra instance to run our check_path calls once the editor was active; but we can avoid that by running all the check_path calls before our editor is active. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: fix committing to subdirectories, add testsLibravatar Eric Wong3-4/+48
I broke this part with the URL minimization; since git-svn will now try to connect to the root of the repository and will end up writing files there if it can... Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: fix segfaults from accessing svn_log_changed_path_tLibravatar Eric Wong2-37/+68
svn_log_changed_path_t structs were being used out of scope outside of svn_ra_get_log (because I wanted to eventually be able to use git-svn with only a single connection to the repository). So now we dup them into a hash. This was fixed while making --follow-parent fetches more efficient. I've moved parsing of the command-line --revision argument outside of the Git::SVN module so Git::SVN::fetch() can be used in more places (such as find_parent_branch). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: correctly track revisions made to deleted branchesLibravatar Eric Wong2-23/+34
git-svn has never been able to handle deleted branches very well because svn_ra_get_log() is all-or-nothing, meaning that if the max revision passed to it does not contain the path we're tracking, we miss all the revisions in the repository. Branches fetched using --follow-parent still do this sub-optimally (will be fixed soon). --follow-parent will soon become the default, so we will assume that when using get_log(); We will also avoid tracking revprops for revisions with no path-related changes since otherwise we just end up pulling logs to paths we don't care about. Also added a test for this to t9104-git-svn-follow-parent.sh and correctly commit the log message in the preceeding test (which conflicted with a filename). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: avoid tracking change-less revisionsLibravatar Eric Wong3-35/+42
They simply aren't interesting to track, and this will allow us to avoid get_log(). Since r0 is covered by this, we need to update the tests to not rely on r0 (which is always empty). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: add an odd test case that seems to cause segfaults over HTTPLibravatar Eric Wong1-0/+15
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: track writes writes to the index in fetchLibravatar Eric Wong1-9/+41
Introducing Git::IndexInfo. This module will probably be useful outside of git-svn, so I'm not putting it in the Git::SVN namespace. This will allow me to more easily avoid the use of get_log() in the future and simply run do_update in incrementing ranges. get_log() should be avoided because there are cases where moved/deleted directories do not track correctly (until --follow-parent is run on a new branch). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: --follow-parent now works on sub-directories of larger branchesLibravatar Eric Wong2-8/+40
This means that tracking the path of: /another-larger/trunk/thunk/bump/thud inside a repository would follow: /larger-parent/trunk/thunk/bump/thud even if the svn log output looks like this: -------------------------------------------- Changed paths: A /another-larger (from /larger-parent:5) -------------------------------------------- Note: the usage of get_log() in git-svn still makes a an assumption that shouldn't be made with regard to revisions existing for a particular path. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: 'init' attempts to connect to the repository root if possibleLibravatar Eric Wong2-21/+89
This allows connections to be used more efficiently and not require users to run 'git-svn migrate --minimize' for new repositories. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: better error reporting if --follow-parent failsLibravatar Eric Wong1-3/+14
This will be useful to me when I try more special-cases of parent-tracking. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: allow 'init' to work outside of testsLibravatar Eric Wong1-0/+1
Tests always ran 'git init' before we ran so that repo-config would always have something to read. However that does not work in real-world situations where the user expects 'git svn init' to work without running 'git init' first. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: get rid of additional fetch-argumentsLibravatar Eric Wong2-25/+6
It's not really useful anymore now that we have a better --follow-parent for the valid cases. Any other use of it is not valid. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: allow --follow-parent on deleted directoriesLibravatar Eric Wong2-1/+13
Any operations on the index in Git::SVN that is not wrapped by tmp_index_do() is wrong. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: disallow ambigious local refspecsLibravatar Eric Wong2-7/+44
Having multiple fetch refspecs pointing to the same local ref would be a very bad thing. Start avoiding the use of fatal() or exit() inside the modules so we can libify more easily. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: --follow-parent works with svn-remotes multiple branchesLibravatar Eric Wong2-17/+45
Bugs fixed: * We didn't allow manually (not using git-svn) init-ed remotes/fetch refspecs to be used before. It works now because that's what I did in this test. git-svn init should offer more control in the future. * correctly strip paths in the delta editor when using do_switch(). * Make the -i / GIT_SVN_ID option work correctly when doing fetch on a multi-ref svn-remote Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: fix --follow-parent to work with Git::SVNLibravatar Eric Wong2-92/+110
While we're at it, beef up the test because I was getting false-passes during development. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: enable --minimize to simplify the config and connectionsLibravatar Eric Wong2-6/+129
--minimize will update the git-svn configuration to attempt to connect to the repository root (instead of directly to the path(s) we are tracking) in order to allow more efficient reuse of connections (for multi-fetch and follow-parent). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: reuse open SVN::Ra connections by URLLibravatar Eric Wong1-4/+6
Note: this can cause problems with Perl's reference counting GC, so I'm disabling Git::SVN::Ra::DESTROY. If we notice more problems down the line, we can disable this enhancement. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: fix a regression in dcommit that caused empty log messagesLibravatar Eric Wong1-1/+2
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: add support for metadata in .git/configLibravatar Eric Wong2-279/+367
Of course, we handle metadata migrations from previous versions and we have added unit tests. The new .git/config remotes resemble non-SVN remotes. Below is an example with comments: [svn-remote "git-svn"] ; like non-svn remotes, we have one URL per-remote url = http://foo.bar.org/svn ; 'fetch' keys are done in the same way as non-svn ; remotes, too. With the left-hand-side of the ':' ; being the remote (SVN) repository path relative to the ; above 'url' key; and the right-hand-side being a ; remote ref in git (refs/remotes/*). ; An empty left-hand-side means that it will fetch ; the entire contents of the 'url' key. ; old-style (migrated from previous versions of git-svn) ; are like this: fetch = :refs/remotes/git-svn ; this is created by a current version of git-svn ; using the multi-init command with an explicit ; url (specified above). This allows multi-init ; to reuse SVN::Ra connections. fetch = trunk:refs/remotes/trunk fetch = branches/a:refs/remotes/a fetch = branches/b:refs/remotes/b fetch = tags/0.1:refs/remotes/tags/0.1 fetch = tags/0.2:refs/remotes/tags/0.2 fetch = tags/0.3:refs/remotes/tags/0.3 [svn-remote "alt"] ; this is another old-style remote migrated over ; to the new config format url = http://foo.bar.org/alt fetch = :refs/remotes/alt Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: remove graft-branches commandLibravatar Eric Wong2-593/+3
It's becoming a maintenance burden. I've never found it particularly useful myself, nor have I heard much feedback about it; so I'm assuming it's just as useless to everyone else. Signed-off-by: Eric Wong <normalperson@yhbt.net>