aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
Commit message (Collapse)AuthorAge
* Merge branch 'ab/require-perl-5.8'Junio C Hamano2010-10-26
|\ | | | | | | | | | | * ab/require-perl-5.8: perl: use "use warnings" instead of -w perl: bump the required Perl version to 5.8 from 5.6.[21]
| * perl: bump the required Perl version to 5.8 from 5.6.[21]Ævar Arnfjörð Bjarmason2010-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Formalize our dependency on perl 5.8, bumped from 5.6.[12]. We already used the three-arg form of open() which was introduced in 5.6.1, but t/t9700/test.pl explicitly depended on 5.6.2. However git-add--interactive.pl has been failing on the 5.6 line since it was introduced in v1.5.0-rc0~12^2~2 back in 2006 due to this open syntax: sub run_cmd_pipe { my $fh = undef; open($fh, '-|', @_) or die; return <$fh>; } Which when executed dies on "Can't use an undefined value as filehandle reference". Several of our tests also fail on 5.6 (even more when compiled with NO_PERL_MAKEMAKER=1): t2016-checkout-patch.sh t3904-stash-patch.sh t3701-add-interactive.sh t7105-reset-patch.sh t7501-commit.sh t9700-perl-git.sh Our code is bitrotting on 5.6 with no-one interested in fixing it, and pinning us to such an ancient release of Perl is keeping us from using useful features introduced in the 5.8 release. The 5.6 series is now over 10 years old, and the 5.6.2 maintenance release almost 7. 5.8 on the other hand is more than 8 years old. All the modern Unix-like operating systems have now upgraded to it or a later version, and 5.8 packages are available for old IRIX, AIX Solaris and Tru64 systems. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Tor Arntsen <tor@spacetec.no> Acked-by: Randal L. Schwartz <merlyn@stonehenge.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: fix processing of decorated commit hashesMathias Lafeldt2010-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | The function working_head_info() fails to parse commit hashes if they are decorated (i.e. log.decorate is true), causing dcommit, rebase, and other vital git-svn commands to malfunction. This patch disables decorated log output with --no-decorate. [ew: wrapped long line] Signed-off-by: Mathias Lafeldt <misfire@debugon.org> Acked-by: Eric Wong <normalperson@yhbt.net>
* | git-svn: check_cherry_pick should exclude commits already in our historySteven Walter2010-09-24
|/ | | | | | | | | | | | | The merge-base between @$parents and $merge_tip may have been reached through a merge commit. This means that some commits that are ancestors of @$parents will not be ancestors of $merge_base. The mergeinfo property will not list commits that are ancestors of @$parents, so we need to explicitly exclude them. [ew: squashed and cleaned up test case from Steven] Signed-off-by: Steven Walter <stevenrwalter@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: fix fetch with deleted tagDavid D. Kilzer2010-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently git-svn assumes that two tags created from the same revision will have the same repo url, so it uses a ref to the tag without checking that its url matches the current url. This causes issues when fetching an svn repo where a tag was created, deleted, and then recreated under the following circumstances: - Both tags were copied from the same revision. - Both tags had the same name. - Both tags had different repository paths. - [Optional] Both tags have a file with the same name but different content. When all four conditions are met, a checksum mismatch error occurs because the content of two files with the same path differs (see t/t9155--git-svn-fetch-deleted-tag.sh): Checksum mismatch: ChangeLog 065854.... expected: ce771b.... got: 9563fd.... When only the first three conditions are met, no error occurs but the tag in git matches the first (deleted) tag instead of the last (most recent) tag (see t/t9156-git-svn-fetch-deleted-tag-2.sh). The fix is to verify that the repo url for the ref matches the current url. If the urls do not match, then a "tail" is grown on the tag name by appending a dash and rechecking the new ref's repo url until either a matching repo url is found or a new tag is created. Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: fix regex to remove "tail" from svn tagsDavid D. Kilzer2010-08-15
| | | | | | | | | | | Fix a regular expression used to remove the revision from the end of an svn tag or branch name. The regex did not account for any "tail" (dashes) that may have been added to the end of the tag name (which first appeared in v1.4.1-rc2~11). If not fixed, tags with names like "tags/mytag@5--@2" may be created. Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git svn: URL-decode left-hand side of svn refspecSteven Walter2010-08-05
| | | | | | | | This change allows git-svn to handle an URL with colons in the path [ew: rewritten to use uri_decode() function] Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git svn: fix dcommit to work with touched filesDavid D. Kilzer2010-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | The dcommit command fails if an otherwise unmodified file has been touched in the working directory: Cannot dcommit with a dirty index. Commit your changes first, or stash them with `git stash'. This happens because "git diff-index" reports a difference between the index and the filesystem: :100644 100644 d00491...... 000000...... M file The fix is to run "git update-index --refresh" before "git diff-index" as is done in git-rebase and git-rebase--interactive before "git diff-files". This changes dcommit to display a list of modified files before exiting. Also add a similar test case for "git svn rebase". [ew: rearranged commit message subject] Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git svn: add an option to recode pathnamesDmitry Statyvka2010-07-30
| | | | | | | | | | | | | Introduce a new option 'svn.pathnameencoding' that instructs git svn to recode pathnames to a given encoding. It can be used by windows users and by those who work in non-utf8 locales to avoid corrupted file names with non-ascii characters. [rp: renamed the option and added manpage documentation] Signed-off-by: Dmitry Statyvka <dstatyvka@tmsoft-ltd.kiev.ua> Signed-off-by: Robert Pollak <robert.pollak@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: write memoized data explicitly to avoid Storable bugSergey Vlasov2010-07-19
| | | | | | | | | | | | | | | | | Apparently using the Storable module during global destruction is unsafe - there is a bug which can cause segmentation faults: http://rt.cpan.org/Public/Bug/Display.html?id=36087 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482355 The persistent memoization support introduced in commit 8bff7c538 relied on global destruction to write cached data, which was leading to segfaults in some Perl configurations. Calling Memoize::unmemoize in the END block forces the cache writeout to be performed earlier, thus avoiding the bug. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Acked-by: Eric Wong <normalperson@yhbt.net>
* git svn: avoid unnecessary '/' in paths for SVNEric Wong2010-06-14
| | | | | | | | | | svn:// servers are more picky regarding redundant slashes than file:// and http(s)://-backed respositories. Since the last commit, we avoid putting unnecessary slashes in $GIT_CONFIG, but this doesn't help users who are already set up that way. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: strip off leading slashes on --trunk argumentJonathan Nieder2010-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following command git svn clone \ -r9500:10006 \ svn://svn.debian.org/svn/pkg-games/packages \ --trunk=/trunk/freedoom \ --branches=/branches/freedoom \ --tags=/tags/freedoom \ freedoom.git.2009091 produces strange results: With v1.6.3.3 (and perhaps earlier versions), this would fetch up to and including r9978 (the last revision of the no_iwad_alternatives branch before it was deleted), check it out, and prematurely declare success, leaving out some commits to the trunk (r9984, r9985, r10006) from after the branch was merged. With v1.6.5-rc0~74 (svn: allow branches outside of refs/remotes, 2009-08-11) and later, this fetches up to and including r9978 and then attempts a post-fetch checkout and fails. r9978 = 25f0920175c395f0f22f54ae7a2318147f745274 (refs/remotes/no_iwad_alternatives) fatal: refs/remotes/trunk: not a valid SHA1 update-ref refs/heads/master refs/remotes/trunk: command returned error: 128 Checking .git/config reveals fetch = packages//trunk/freedoom:refs/remotes/trunk And with both 1.6.3.3 and 1.7.1, using --trunk=trunk/freedom without the leading slash (/) works fine. Moral: git-svn needs to scrub an initial / from $_trunk and related arguments it receives. Make it so. Reported-by: Jon Dowland <jmtd@debian.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git svn: fix empty directory creationMichael J. Kiwala2010-06-03
| | | | | | | | | | | | Avoid attempts to stat() the contents of '', which could happen when the root directory is empty. Additionally, remove the unnecessary '_' stat optimization since it was confusing and possibly throwing off the non-existent case. [ew: fixed indentation, rewrote commit message] Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Michael J. Kiwala <mkiwala@genome.wustl.edu>
* git-svn: mangle refnames forbidden in gitTorsten Schmutzler2010-05-09
| | | | | | | | | | git-check-ref-format(1) describes names which cannot be used as refnames for git. Some are legal branchnames in subversion however. Mangle the not yet handled cases. Signed-off-by: Torsten Schmutzler <git-ts@theblacksun.eu> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: Remove unused use of File::TempÆvar Arnfjörð Bjarmason2010-05-09
| | | | | | | | | The use line was added in ffe256f9. File::Temp calls were later moved to Git.pm in 0b19138b, but that commit neglected to remove the now-redundant import. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git svn: avoid uninitialized var in 'reset'Jonathan Nieder2010-05-09
| | | | | | | | | | | When "git svn reset" is called with an invalid revision, we bail out and show the user a proper error message instead of giving them a cryptic one related to git-svn internals. ref: http://bugs.debian.org/578908 Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Reported-by: Jens Seidel <jensseidel@users.sf.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* Merge branch 'fl/askpass'Junio C Hamano2010-03-20
|\ | | | | | | | | | | * fl/askpass: git-core: Support retrieving passwords with GIT_ASKPASS git-svn: Support retrieving passwords with GIT_ASKPASS
| * git-svn: Support retrieving passwords with GIT_ASKPASSFrank Li2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | git-svn reads passwords from an interactive terminal. This behavior cause GUIs to hang waiting for git-svn to complete Fix this problem by allowing a password-retrieving command to be specified in GIT_ASKPASS. SSH_ASKPASS is supported as a fallback when GIT_ASKPASS is not provided. Signed-off-by: Frank Li <lznuaa@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: Fix merge detecting with rewrite-rootTuomas Suutari2010-03-13
| | | | | | | | | | | | | | | | Detecting of merges from svn:mergeinfo or svk merge tickets failed with rewrite-root option. This fixes it. Signed-off-by: Tuomas Suutari <tuomas.suutari@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* | git-svn: make git svn --version work againMichael J Gruber2010-03-05
| | | | | | | | | | | | | | by requesting SVN::Core which is needed for the svn version. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* | Revert "git-svn: always initialize with core.autocrlf=false"Erik Faye-Lund2010-03-05
| | | | | | | | | | | | | | | | | | | | | | git-svn rebase used to have issues with CRLF conversion. Since these issues have been fixed, we can safely revert the work-around that disables CRLF conversion. This reverts commit d3c9634eacdcaa71cbd69a160e6f4e80ddb7ab63. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* | git-svn: req_svn when neededMichael J Gruber2010-03-04
| | | | | | | | | | | | | | | | The delayed loading of SVN missed a place where SVN::Core is used. Make sure to load the package before trying to use it. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* | Merge branch 'jn/maint-fix-pager'Junio C Hamano2010-03-02
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | * jn/maint-fix-pager: tests: Fix race condition in t7006-pager t7006-pager: if stdout is not a terminal, make a new one tests: Add tests for automatic use of pager am: Fix launching of pager git svn: Fix launching of pager git.1: Clarify the behavior of the --paginate option Make 'git var GIT_PAGER' always print the configured pager Fix 'git var' usage synopsis
| * git svn: Fix launching of pagerJonathan Nieder2010-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit dec543e (am -i, git-svn: use "git var GIT_PAGER"), I tried to teach git svn to defer to git var on what pager to use. In the process, I introduced two bugs: - The value set for $pager in config_pager has local scope, so run_pager never sees it; - git var cannot tell whether git svn’s output is going to a terminal, so the value chosen for $pager does not reflect that information. Fix them. Reported-by: Sebastian Celis <sebastian@sebastiancelis.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git svn: delay importing SVN::Base until it is neededjosh robb2010-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Importing functions from a .dll into Git for Windows' perl is pretty slow, so let's avoid importing if it is not necessary. This seems particularly slow in virtualized enviroments. Before this change (on my machine): $ time perl /libexec/git-core/git-svn rebase Current branch master is up to date. real 2m56.750s user 0m3.129s sys 2m39.232s Afterwards: $ time perl /libexec/git-core/git-svn rebase Current branch master is up to date. real 0m33.407s user 0m1.409s sys 0m23.054s git svn rebase -n goes from 3m7.046s to 0m10.312s. Signed-off-by: Josh Robb <josh_robb@fastmail.fm> Acked-by: Eric Wong <normalperson@yhbt.net>
* | git-svn: Fix discarding of extra parents from svn:mergeinfoTuomas Suutari2010-02-26
|/ | | | | | | | | | | If parent J is an ancestor of parent I, then parent J should be discarded, not I. Note that J is an ancestor of I if and only if rev-list I..J is emtpy, which is what we are testing here. Signed-off-by: Tuomas Suutari <tuomas.suutari@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: persistent memoizationAndrew Myrick2010-02-04
| | | | | | | | | | | | | | | Make memoization of the svn:mergeinfo processing functions persistent with Memoize::Storable so that the memoization tables don't need to be regenerated every time the user runs git-svn fetch. The Memoize::Storable hashes are stored in ENV{GIT_DIR}/svn/.caches. [ew: changed caches path to avoid conflicts with old repos] [ew: File::Path::{make_path => mkpath} for compatibility] [ew: line-wrapped at 80 chars] Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Andrew Myrick <amyrick@apple.com>
* If deriving SVN_SSH from GIT_SSH on msys, also add quotesSebastian Schuberth2010-01-29
| | | | | | | | | | | | | | In contrast to GIT_SSH, SVN_SSH requires quotes for paths that contain spaces. As GIT_SSH will not work if it contains quotes, it is safe to assume it never contains quotes. Also, adding quotes to SVN_SSH for paths that do not contain spaces does no harm. So we always add quotes when deriving SVN_SSH from GIT_SSH on msys. This fixes msysGit issue 385, see http://code.google.com/p/msysgit/issues/detail?id=385 Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: allow subset of branches/tags to be specified in glob specJay Soffian2010-01-23
| | | | | | | | | | | | For very large projects it is useful to be able to clone a subset of the upstream SVN repo's branches. Allow for this by letting the left-side of the branches and tags glob specs contain a brace-delineated comma-separated list of names. e.g.: branches = branches/{red,green}/src:refs/remotes/branches/* Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: allow UUID to be manually remapped via rewriteUUIDJay Soffian2010-01-23
| | | | | | | | | | | | | | | | | | | | | | | | In certain situations it may be necessary to manually remap an svn repostitory UUID. For example: o--- [git-svn clone] / [origin svn repo] \ o--- [svnsync clone] Imagine that only "git-svn clone" and "svnsync clone" are made available to external users. Furthur, "git-svn clone" contains only trunk, and for reasons unknown, "svnsync clone" is missing the revision properties that normally provide the origin svn repo's UUID. A git user who has cloned the "git-svn clone" repo now wishes to use git-svn to pull in the missing branches from the "synsync clone" repo. In order for git-svn to get the history correct for those branches, it needs to know the origin svn repo's UUID. Hence rewriteUUID. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: add --username/commit-url options for branch/tagIgor Mironov2010-01-23
| | | | | | | | | | Add ability to specify on the command line the username to perform the operation as and the writable URL of the repository to perform it on. [ew: shortened subject] Signed-off-by: Igor Mironov <igor.a.mironov@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: respect commiturl option for branch/tagIgor Mironov2010-01-23
| | | | | | | | | | | | | When constructing a destination URL, use the property 'commiturl' if it is specified in the configuration file; otherwise take 'url' as usual. This accommodates the scenario where a user only wants to involve the writable repository in operations performing a commit and defaults everything else to a read-only URL. [ew: shortened subject] Signed-off-by: Igor Mironov <igor.a.mironov@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: fix mismatched src/dst errors for branch/tagIgor Mironov2010-01-23
| | | | | | | | | | | | | | | | | | This fixes the following issue: $ git svn branch -t --username=svnuser \ --commit-url=https://myproj.domain.com/svn mytag Copying http://myproj.domain.com/svn/trunk at r26 to https://myproj.domain.com/svn/tags/mytag... Trying to use an unsupported feature: Source and dest appear not to be in the same repository (src: 'http://myproj.domain.com/svn/trunk'; dst: 'https://myproj.domain.com/svn/tags/mytag') [ew: shortened subject] Signed-off-by: Igor Mironov <igor.a.mironov@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: handle merge-base failuresAndrew Myrick2010-01-23
| | | | | | | | | | | | | Change git-svn to warn and continue when merge-base fails while processing svn merge tickets. merge-base can fail when a partial branch is created and merged back to trunk in svn, because it cannot find a common ancestor between the partial branch and trunk. Signed-off-by: Andrew Myrick <amyrick@apple.com> Acked-by: Sam Vilain <sam@vilain.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: ignore changeless commits when checking for a cherry-pickAndrew Myrick2010-01-23
| | | | | | | | | | | | | | | | | | | | | | | Update git-svn to ignore commits that do not change the tree when it is deciding if an svn merge ticket represents a real branch merge or just a cherry-pick. Consider the following integration model in the svn repository: F---G branch1 / \ D tag1 \ E tag2 / \ / A---B C trunk branch1 is merged to trunk in commit C. With this patch, git-svn will correctly identify branch1 as a proper merge parent, instead of incorrectly ignoring it as a cherry-pick. Signed-off-by: Andrew Myrick <amyrick@apple.com> Acked-by: Sam Vilain <sam@vilain.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git svn: branch/tag commands detect username in URLsEric Wong2009-12-23
| | | | | | | | | | | svn+ssh:// repositories often have userinfo embedded in the URL which were stripped out of the "git-svn-id:" trailers. Since the SVN::Client::copy function takes userinfo into account when matching URLs for SVN repositories, we need to retrieve the full URL with embedded userinfo in it to avoid mismatched URLs. Tested-by: Florian Köberle <florian@fkoeberle.de> Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git svn: lookup new parents correctly from svn:mergeinfoEric Wong2009-12-22
| | | | | | | | This appears to be a trivial case where array indices were being passed to git rev-list, instead of the contents stored in the array itself. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: Remove obsolete MAXPARENT checkAndrew Myrick2009-12-21
| | | | | | | | | | | | | | Change git-svn not to impose a limit of 16 parents on a merge. This limit in git-svn artificially prevents cloning svn repositories that contain commits with more than 16 merge parents. The limit was removed from builtin-commit-tree.c for git v1.6.0 in commit ef98c5cafb3e799b1568bb843fcd45920dc62f16, so there is no need to check for it it in git-svn. Signed-off-by: Andrew Myrick <amyrick@apple.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: detect cherry-picks correctly.Sam Vilain2009-12-21
| | | | | | | | | | | | The old function was incorrect; in some instances it marks a cherry picked range as a merged branch (because of an incorrect assumption that 'rev-list COMMIT --not RANGE' would work). This is replaced with a function which should detect them correctly, memoized to limit the expense of dealing with branches with many cherry picks to one 'merge-base' call per merge, per branch which used cherry picking. Signed-off-by: Sam Vilain <sam@vilain.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: exclude already merged tips using one rev-list callSam Vilain2009-12-21
| | | | | | | | | | | | | | | The old function would have to check all mentioned merge tips, every time that the mergeinfo ticket changed. This involved 1-2 rev-list operation for each listed mergeinfo line. If there are a lot of feature branches being merged into a trunk, this makes for a very expensive operation for detecting the new parents on every merge. This new version first uses a single 'rev-list' to figure out which commit ranges are already reachable from the parents. This is used to eliminate the already merged branches from the list. Signed-off-by: Sam Vilain <sam@vilain.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: fix some mistakes with interpreting SVN mergeinfo commit rangesSam Vilain2009-12-21
| | | | | | | | | | SVN's list of commit ranges in mergeinfo tickets is inclusive, whereas git commit ranges are exclusive on the left hand side. Also, the end points of the commit ranges may not exist; they simply delineate ranges of commits which may or may not exist. Fix these two mistakes. Signed-off-by: Sam Vilain <sam@vilain.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: memoize conversion of SVN merge ticket info to git commit rangesSam Vilain2009-12-21
| | | | | | | | | | | | | Each time the svn mergeinfo ticket changes, we look it up in the rev_map; when there are a lot of merged branches, this will result in many repeated lookups of the same information for subsequent commits. Arrange the slow part of the function so that it may be memoized, and memoize it. The more expensive revision walking operation can be memoized separately. [ew: changed "next" to "return" for function exit] Signed-off-by: Sam Vilain <sam@vilain.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git svn: fix --revision when fetching deleted pathsEric Wong2009-12-21
| | | | | | | | | | | | | | | | When using the -r/--revision argument to fetch deleted history, calling SVN::Ra::get_log() from an SVN::Ra object initialized to track the deleted URL will fail. This regression was introduced in: commit 4aacaeb3dc82bb6479e70e120053dc27a399460e "fix shallow clone when upstream revision is too new" We now ignore errors from SVN::Ra::get_log() here because using --revision will always override the value of $head here if (and only if) we're tracking deleted directories. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git svn: make empty directory creation gc-awareEric Wong2009-12-19
| | | | | | | | | The "git svn gc" command creates and appends to unhandled.log.gz files which should be parsed before the uncompressed unhandled.log files. Reported-by: Robert Zeh Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: set svn.authorsfile earlier when cloningAlex Vandiver2009-12-08
| | | | | | | | | | If a clone errors out because of a missing author, or user interrupt, this allows `git svn fetch` to resume seamlessly, rather than forcing the user to re-provide the path to the authors file. [ew: shortened subject] Signed-off-by: Alex Vandiver <alex@chmrr.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: Set svn.authorsfile to an absolute path when cloningAlex Vandiver2009-12-08
| | | | | | | | | | If --authors-file is passed a relative path, cloning will work, but future `git svn fetch`es will fail to locate the authors file correctly. Thus, use File::Spec->rel2abs to determine an absolute path for the authors file before setting it. Signed-off-by: Alex Vandiver <alex@chmrr.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git svn: log removals of empty directoriesEric Wong2009-12-07
| | | | | | | | This also adds a test case for: "git svn: Don't create empty directories whose parents were deleted" which was the reason we found this bug in the first place. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git svn: Don't create empty directories whose parents were deletedGreg Price2009-12-07
| | | | | | | | | | | | | | | | | | | | | | Commit 6111b93 "git svn: attempt to create empty dirs on clone+rebase" will create empty directories 'a/b' and 'a/c' if they were previously created in SVN, even if their parent directory 'a' was deleted. For example, unhandled.log may contain lines like this: r32 +empty_dir: packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/sipb-xen-auto/acl +empty_dir: packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/sipb-xen-auto/machine.d +empty_dir: packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/sipb-xen-auto/moira-acl [...] r314 -empty_dir: packages/sipb-xen-remctl-auto [ew: rewrote to be line-wrapped at <= 80-columns] Reported-by: Evan Broder <broder@mit.edu> Signed-off-by: Greg Price <price@ksplice.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* git-svn: sort svk merge tickets to account for minimal parentsAlex Vandiver2009-12-07
| | | | | | | | | | | When merging branches based on svk:merge properties, a single merge can have updated or added multiple svk:merge lines. Attempt to include the minimal set of parents by sorting the merge properties in order of revision, highest to lowest. Signed-off-by: Alex Vandiver <alex@chmrr.net> Acked-by: Sam Vilain <sam@vilain.net> Acked-by: Eric Wong <normalperson@yhbt.net>
* git svn: strip leading path when making empty dirsEric Wong2009-11-22
| | | | | | | | | Since unhandled.log stores paths relative to the repository root, we need to strip out leading path components if the directories we're tracking are not the repository root. Reported-by: Björn Steinbrink Signed-off-by: Eric Wong <normalperson@yhbt.net>