summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2007-02-23git-svn: include merges when calling rev-list for decommitLibravatar Eric Wong1-1/+1
Merge commits can be created when following certain parents, (most notably 'R' cases) and we definitely don't want to exclude them. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: make dcommit usable for glob usersLibravatar Eric Wong1-22/+51
* dcommit no longer requires the correct -i/GIT_SVN_ID option passed to it. Since you're committing from HEAD (or another commit that is a parent of HEAD), you'll be able to find a commit with metadata information containing the SVN URL that your HEAD was descended from anyways. * I don't think dcommit ever worked for people using the noMetadata option; so I don't think relying on metadata is an issue. * useSvmProps users shouldn't commit to SVN::Mirror created repositories anyways, right? * Users of globbing should automatically be able to commit to paths that are not explicitly set in .git/config Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: make test for SVK mirror path importLibravatar sam@vilain.net2-1/+105
A manual test that sets up a repository that looks like an SVK depot, and then imports it to check that it looks like we mirrored the 'original' source. There is also a minor modification to the git-svn test library shell file which sets a variable for the subversion repository's filesystem path. [ew: made some of the tests stricter and more thorough] Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: handle multi-init without --trunk, UseSvmProps fixesLibravatar Eric Wong1-33/+83
multi-init did not write a svn-remote.<remote>.url config entry without a --trunk argument. Also, The svm:mirror property is used by SVN::Mirror to track the path of the repository that we are mirroring. We need to append that to the source (which is (presumably) just the URL of the repository root). Lastly, we now look harder for svm:(source|mirror|uuid) properties in sub and parent directories. Since our relative path could be tweaked. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: write the highest maxRex out for branches and tagsLibravatar Eric Wong1-0/+4
Even if nothing touched paths we care about in a fetch; increment the maxRev like we do with rev_db since we don't like having to run get_log on revisions we've seen before. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: use separate, per-repository .rev_db filesLibravatar Eric Wong2-50/+134
We need a separate .rev_db file for each repository we're tracking. This allows us to track the same logical path off multiple mirrors. We preserve a symlink to the old .rev_db (no-UUID) if we're (auto-)migrating from an old version to preserve backwards compatibility. Also, get rid of the uuid() wrapper since we cache UUID in our private config, and the SVN::Ra::get_uuid() function memoizes the return value per-connection. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: extra safety for noMetadata and useSvmProps usersLibravatar Eric Wong2-12/+43
Make sure we flush our userspace buffers and and fsync(2) .rev_db information to disk if we use these options because we really don't want to lose this information. Also, disallow --use-svm-props and --no-metadata from the command-line because history will be inconsistent if they're only used occasionally. If a user wants to use these options, they must be set in the config so they're always on. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: use private $GIT_DIR/svn/config file moreLibravatar Eric Wong1-32/+21
Switch max_rev storage over to using it for globbing branches and tags. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: add support for per-[svn-remote "..."] optionsLibravatar Eric Wong1-9/+35
Available options are currently: svn-remote.<remote>.{noMetadata,useSvmProps,followParent} These boolean switches will override options set globally in [svn], and even override options set on the command-line (this should probably change in the future, however). Note that the noMetadata and useSvmProps options conflict. It's both technically and logically impossible to use them together. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: add support for SVN::Mirror/svk using revprops for metadataLibravatar Eric Wong1-10/+105
Pass --use-svm-props or set the svn.usesvmprops key with git-config to enable using properties set by SVN::Mirror when it mirrored the upstream URL. This is heavily based on work from Sam Vilain: > From: Sam Vilain <sam@vilain.net> > Date: Sun, 11 Feb 2007 12:34:45 +1300 > Subject: [PATCH] git-svn: re-map repository URLs and UUIDs on SVK mirror paths > > If an SVN revision has a property, "svm:headrev", it is likely that > the revision was created by SVN::Mirror (a part of SVK). The property > contains a repository UUID and a revision. We want to make it look > like we are mirroring the original URL, so introduce a helper function > that returns the original identity URL and UUID, and use it when > generating commit messages. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: remove optimized commit stuff for set-treeLibravatar Eric Wong1-10/+2
I may resurrect it for dcommit at some point, but nobody really uses set-tree anymore and I don't feel like introducing more complexity into the code at this point. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: correctly handle globs with a right-hand-side path componentLibravatar Eric Wong2-24/+113
Several bugs were found and fixed while getting this to work: * Remember the 'R'(eplace) case of actions and treat it like we would an 'A'(dd) case. * Fix a small case of follow-parent missing a parent if a subdirectory was modified in the revision where the parent was copied. * dirents returned by get_dir sometimes expire if the data structure is too big and the pool is destroyed, so we cache get_dir (along with check_path and get_revprops) temporarily along with its pool. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: correctly handle the -q flag in SVN::Git::FetcherLibravatar Eric Wong1-4/+4
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: fix buggy regular expression usage in several placesLibravatar Eric Wong1-13/+19
I incorrectly used $path/? and $path/* to strip off leading directories, but places where $path = 'branches/0.17' would incorrectly strip changes to 'branches/0.17.1' as well. For globs, we require that our '*' is its own path component (surrounded by '/' or nothing). Enforce this when --prefix= is passed to us, too. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: enable follow-parent functionality by defaultLibravatar Eric Wong3-16/+17
--no-follow-parent disables and reverts it back to the old default behavior of not following parents (if you don't care for full history). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: remove some noisy debugging messagesLibravatar Eric Wong1-19/+2
We don't need them anymore, all the rough points of the --follow-parent implementation have been worked out. The only improvement in the future will probably be --follow-parent-harder, which will track subdirectories and follow individual file history (so annotate/blame can be complete); but that is still a ways off. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: remove check_path calls before calling do_updateLibravatar Eric Wong1-8/+3
These checks were needed before git-svn got smarter about match_paths() and using path information returned by get_log(). We also have extra checking against fetching revisions out-of-order these days; so we don't have to worry about that as much. We also check for tree deletions in match_paths() and skip those as well. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: --follow-parent tracks multi-parent pathsLibravatar Eric Wong2-3/+18
We can have a branch that was deleted, then re-added under the same name but copied from another path, in which case we'll have multiple parents (we don't want to break the original ref, nor lose copypath info). Add a test for this, too, of course. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: implement auto-discovery of branches/tagsLibravatar Eric Wong1-28/+120
This is similar to the way git proper handles refs, except we use the keys 'branches' and 'tags' to distinguish when we want to use wildcards. The left-hand side of the ':' contains the remote path, and must have one asterisk ('*') in it for the branch name. The asterisk may be in any component of the path as long as is it on its own directory level. The right-hand side contains the refname and must have the asterisk as the last path component. branches = branches/*:refs/remotes/* tags = tags/*:refs/remotes/tags/* Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-02-23git-svn: run get_log() on a sub-directory if possibleLibravatar Eric Wong1-7/+48
This is an optimization that should conserve network bandwidth on certain repositories and configurations. Signed-off-by: Eric Wong <normalperson@yhbt.net>
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>