aboutsummaryrefslogtreecommitdiffstats
path: root/src/repository.h
Commit message (Collapse)AuthorAgeFilesLines
* Add a resetBranch() to help refactor createBranch and deleteBranch.Raja R Harinath2010-07-201-0/+2
| | | | Only deleteBranch uses it for now.
* Remove exit(1) in createBranch. Return EXIT_SUCCESS/EXIT_FAILURE insteadRaja R Harinath2010-07-201-3/+3
| | | | | | Allow graceful exit of all fast-import processes when createBranch fails. For consistency, add return value to deleteBranch, even though it always returns EXIT_SUCCESS.
* Make error handling of --incremental and --resume-from idempotentRaja R Harinath2010-07-111-0/+1
| | | | | | | | | | | When --resume-from failed in incremental mode, the log files that detected the error condition were truncated. So, if the same command line was executed again, the invocation would go through. We now restore the log files from backup when we detect we're going to fail. The restored log files may not all be the same as we originally started with, but we only truncate information that would anyway be truncated on the next successful run.
* make --incremental robust to inconsistent import directoriesRaja R Harinath2010-07-101-1/+1
| | | | | | | | | | | | | | An interrupted import (say with Ctrl-C) can leave the import directory in an inconsistent state. This can be due to checkpointing fast-import only occassionally, but updating log-* files immediately, and/or other reasons. The incremental mode can detect certain such situations and rewind back to a safe state. Note that since the default commit-interval is quite large, this rewind can end up backtracking a lot. Note also that import interrupted under the control of svn2git, say, for missing rules should leave the import directory in a consistent state for the purpose of svn2git.
* Reduce size of fast-import marks file by not persisting file-level marksRaja R Harinath2010-07-101-1/+10
| | | | | | | | | | | | | | | | Use two allocators for marks, one persistent commit counter that starts at 0 and counts up commits, and a transitional counter, for files, that counts down from maxMark, and is reset on each SVN revision. Note that the marks file will still have marks for some, but not all, files. The number of such marks is limited by the size of the SVN revision that affects the most files. For instance, this changed the size of one marks file from 19M to 3.2M. fast-import issues: We currently set maxMark = (1<<20)-1. Anything large seems to trigger a bug in the sparse array dumping routine in git-fast-import in certain versions of git.
* Introduce incremental mode with --incremental flagRaja R Harinath2010-07-091-0/+1
| | | | | | | | | | | | | We use the progress logs that we carefully maintained to recreate the branch data structures, as described in earlier commits. A major change/improvement is that reloadBranches() now uses the marks file and internal data structures to prime the fast-import rather than using git-rev-parse. We also handle --resume-from properly, by truncating the log file to revisions that only precede the revision resumed from. Note that git fast-import allows marks to be reused without any extra processing.
* Handle SVN directory deletes that lead to branch deletesRaja R Harinath2010-07-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | SVN directory deletes often indicate one or more branch deletions. However, since the deleted directory isn't present in the resulting revision, several of the indicators used by the rule-application mechanism aren't present. This forces us to introduce several useless dummy rules to avoid errors. We now note deletions and use the previous revision to determine several properties, including whether the deleted item is a directory or not, and to enumerate the contents of the directory in recurse mode. We add an additional heuristic for unknown repositories -- i.e., when a rule fired, but it's repository was invalid. We recurse in this case hoping to catch a more specific rule. I believe this is safe: because some other rule must've seen the same directory before, when it or a subdirectory was created, and decided _not_ to create a repository at that point -- so recursing and/or ignoring the contents of the just deleted directory won't corrupt the history, it can only improve it. We use mark :0 to note mark deletions internally, and in the progress logs. (Note that cvs2svn creates wierd commits where a whole tree is copied first, and then subtrees are pruned. In such cases, neither the previous revision nor the current revision have the deleted directory -- we ignore this case as before. There's no information loss since the final contents of the revision are exactly what is desired.)
* Move SVN revision to fast-import mark mapping to the per-branch datastructure.Raja R Harinath2010-07-051-1/+1
| | | | | | A single SVN revision can affect multiple branches in the same repository. Keeping track of only one mark per revision loses information and makes the history incorrect.
* Infer some copy sources as additional parentsRaja R Harinath2010-07-011-0/+4
| | | | | | | | | | | | | | We use a literal meaning of multiple commit parents to allow us to infer some partial repository copying as merges. This helps us 1) track history despite some directory reorganization 2) link subset commits to parents 3) infer some merges which were achieved by overwriting a subtree with contents from another branch This seems to work well enough even with cvs2svn monster commits. The heuristics have been tuned by gut feel to work reasonably well with mono's SVN repository. They can definitely be improved.
* Track commits per-branchRaja R Harinath2010-06-201-1/+1
| | | | | | | | | | | | Previously, all the SVN commits were tracked in a linear array, and we searched for nearest commits in that array. However, SVN history is not linear, and the 'next smallest commit' search was picking the wrong commit. I've moved the commit array into the 'Branch' structure. As a minor subtlety, the branch creation revision is also noted in the 'commitMarks' structure, by copying the commit mark of the branch point. We need this to ensure that the commits array is strictly non-decreasing.
* Try and branch from the correct svn revision rather then the last one.Torgny Nyblom2010-05-041-0/+3
|
* Change license on files where I am copyright holder to GPLv3.Thiago Macieira2010-03-031-1/+1
| | | | | The GPLv2 is incompatible with the Apache 2.0 License used in the SVN libs. So everyone was using this software under the GPLv3 anyway. Formalise it now.
* Add support for annotated tagsThiago Macieira2009-06-081-0/+15
|
* Fix a bug when committing to two branches of the same repository in the same ↵Thiago Macieira2008-08-261-1/+2
| | | | SVN revision
* Store the modified files in git-fast-import format already.Thiago Macieira2008-08-241-5/+1
| | | | I don't know what went wrong, but importing KDE revision 296047 there was a mixup with the marks. So instead avoid the trouble and store the thing in in cooked format already
* Add a process cache to keep the number of processes under 100Thiago Macieira2008-08-231-0/+2
|
* Fail if writing to the process failsThiago Macieira2007-12-281-0/+1
|
* checkpoint every now and thenThiago Macieira2007-12-261-0/+1
|
* Don't crash when running in dry-modeThiago Macieira2007-12-251-1/+1
|
* Keep track of when a given branch was created insteadThiago Macieira2007-12-251-1/+1
|
* remove the source branch in the rulesThiago Macieira2007-12-241-1/+0
|
* Add support for branch creation on-the-flyThiago Macieira2007-12-241-0/+2
|
* Add support for resuming workThiago Macieira2007-12-241-0/+3
|
* Fix crashes and improve behaviourThiago Macieira2007-12-241-0/+1
|
* Implement the commit transactionThiago Macieira2007-12-231-1/+3
|
* Add SVN codeThiago Macieira2007-12-231-4/+39
|
* Add the Repository classThiago Macieira2007-12-231-0/+43