diff options
author | Ulrich Spörlein <uqs@spoerlein.net> | 2010-09-28 22:01:29 +0200 |
---|---|---|
committer | Ulrich Spörlein <uqs@spoerlein.net> | 2012-05-11 15:48:21 +0200 |
commit | 2ae83eb1c5f9b4560e3fa808cb883829c7973a4a (patch) | |
tree | 028b20bf0fd5d7a2a1dc388741fa1ec831a89fce /src/main.cpp | |
parent | 371abece8cbaf9d0c396c3ab8d4fdd1ab2718e7d (diff) | |
download | svn2git-2ae83eb1c5f9b4560e3fa808cb883829c7973a4a.tar svn2git-2ae83eb1c5f9b4560e3fa808cb883829c7973a4a.tar.gz svn2git-2ae83eb1c5f9b4560e3fa808cb883829c7973a4a.tar.bz2 svn2git-2ae83eb1c5f9b4560e3fa808cb883829c7973a4a.tar.xz svn2git-2ae83eb1c5f9b4560e3fa808cb883829c7973a4a.zip |
Allow user-overriding of default email domain
Lazy projects where svn user X has email X@project.org don't need to
compile (and update) an identity-map for rolling conversions.
This can be mixed with a real identity-map, so only misses in the map
will have the user then show up as X@project.org
Also change the defaults somewhat. I don't like the NFS reserved
username nobody to show up in SVN or git logs, but am keeping that for
now.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 60c6bb8..09a4225 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -121,6 +121,7 @@ QSet<int> loadRevisionsFile( const QString &fileName, Svn &svn ) static const CommandLineOption options[] = { {"--identity-map FILENAME", "provide map between svn username and email"}, + {"--identity-domain DOMAIN", "provide user domain if no map was given"}, {"--revisions-file FILENAME", "provide a file with revision number that should be processed"}, {"--rules FILENAME[,FILENAME]", "the rules file(s) that determines what goes where"}, {"--add-metadata", "if passed, each git commit will have svn commit info"}, @@ -172,9 +173,9 @@ int main(int argc, char **argv) out << "svn-all-fast-export failed: please specify the rules using the 'rules' argument\n"; return 11; } - if (!args->contains("identity-map")) { + if (!args->contains("identity-map") && !args->contains("identity-domain")) { QTextStream out(stderr); - out << "WARNING; no identity-map specified, all commits will be without email address\n\n"; + out << "WARNING; no identity-map or -domain specified, all commits will use default @localhost email address\n\n"; } QCoreApplication app(argc, argv); @@ -240,6 +241,11 @@ int main(int argc, char **argv) svn.setMatchRules(rulesList.allMatchRules()); svn.setRepositories(repositories); svn.setIdentityMap(loadIdentityMapFile(args->optionArgument("identity-map"))); + // Massage user input a little, no guarantees that input makes sense. + QString domain = args->optionArgument("identity-domain").simplified().remove(QChar('@')); + if (domain.isEmpty()) + domain = QString("localhost"); + svn.setIdentityDomain(domain); if (max_rev < 1) max_rev = svn.youngestRevision(); |