git-svn: extra safety for noMetadata and useSvmProps users

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>
This commit is contained in:
Eric Wong
2007-02-11 15:21:24 -08:00
parent 93f2689ccd
commit 97ae091169
2 changed files with 42 additions and 11 deletions

View File

@ -316,17 +316,33 @@ for more information on using GIT_SVN_ID.
config key: svn.followparent
--no-metadata::
svn.noMetadata:
svn-remote.<name>.noMetadata:
This gets rid of the git-svn-id: lines at the end of every commit.
If you lose your .git/svn/git-svn/.rev_db file, git-svn will not
be able to rebuild it and you won't be able to fetch again,
either. This is fine for one-shot imports.
The 'git-svn log' command will not work on repositories using this,
either.
The 'git-svn log' command will not work on repositories using
this, either. Using this conflicts with the 'useSvmProps'
option for (hopefully) obvious reasons.
config key: svn.nometadata
svn.useSvmProps:
svn-remote.<name>.useSvmProps:
This allows git-svn to re-map repository URLs and UUIDs from
mirrors created using SVN::Mirror (or svk) for metadata.
If an SVN revision has a property, "svm:headrev", it is likely
that the revision was created by SVN::Mirror (also used by 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 metadata in commit
messages.
Using this conflicts with the 'noMetadata' option for
(hopefully) obvious reasons.
--