# # # add_file "svn_import.cc" # content [b3adf6a76bd8b38b3c61f96e0d1faf6266356968] # # add_file "svn_import.hh" # content [7b76ed4aaa329fa942f7bc615cb45dd7ddf63565] # # patch "Makefile.am" # from [ecc00e0b8e9b5350157a1922e430ade4508d31bd] # to [cd190aad8d0a33763b337b924e24e87fdd700c0c] # # patch "cmd_othervcs.cc" # from [daf6234e9e5fa47816ab74830e2de1973fe44712] # to [efc569b31622fe4a754c87c1093cf88017442ffd] # ============================================================ --- svn_import.cc b3adf6a76bd8b38b3c61f96e0d1faf6266356968 +++ svn_import.cc b3adf6a76bd8b38b3c61f96e0d1faf6266356968 @@ -0,0 +1,29 @@ +// Copyright (C) 2007 Markus Schiltknecht +// +// This program is made available under the GNU GPL version 2.0 or +// greater. See the accompanying file COPYING for details. +// +// This program is distributed WITHOUT ANY WARRANTY; without even the +// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +// PURPOSE. + +#include "cert.hh" +#include "cmd.hh" +#include "app_state.hh" +#include "keys.hh" +#include "svn_import.hh" + +using std::string; + +void +import_svn_repo(std::istream const & is, app_state & app) +{ + // early short-circuit to avoid failure after lots of work + rsa_keypair_id key; + get_user_key(key, app); + require_password(key, app); + + N(app.opts.branchname() != "", F("need base --branch argument for importing")); + + string branch = app.opts.branchname(); +}; ============================================================ --- svn_import.hh 7b76ed4aaa329fa942f7bc615cb45dd7ddf63565 +++ svn_import.hh 7b76ed4aaa329fa942f7bc615cb45dd7ddf63565 @@ -0,0 +1,26 @@ +#ifndef __SVN_IMPORT_HH__ +#define __SVN_IMPORT_HH__ + +// Copyright (C) 2007 Markus Schiltknecht +// +// This program is made available under the GNU GPL version 2.0 or +// greater. See the accompanying file COPYING for details. +// +// This program is distributed WITHOUT ANY WARRANTY; without even the +// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +// PURPOSE. + +#include "vocab.hh" +#include "database.hh" + +void import_svn_repo(std::istream const & is, app_state & app); + +// Local Variables: +// mode: C++ +// fill-column: 76 +// c-file-style: "gnu" +// indent-tabs-mode: nil +// End: +// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s: + +#endif // __SVN_IMPORT_HH__ ============================================================ --- Makefile.am ecc00e0b8e9b5350157a1922e430ade4508d31bd +++ Makefile.am cd190aad8d0a33763b337b924e24e87fdd700c0c @@ -51,6 +51,7 @@ MOST_SOURCES = \ merkle_tree.cc merkle_tree.hh \ lcs.cc lcs.hh \ rcs_import.cc rcs_import.hh \ + svn_import.cc svn_import.hh \ revision.cc revision.hh \ cset.cc cset.hh \ roster.cc roster.hh \ ============================================================ --- cmd_othervcs.cc daf6234e9e5fa47816ab74830e2de1973fe44712 +++ cmd_othervcs.cc efc569b31622fe4a754c87c1093cf88017442ffd @@ -7,11 +7,17 @@ // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. +#include +#include + #include "cmd.hh" #include "app_state.hh" #include "rcs_import.hh" +#include "svn_import.hh" using std::vector; +using std::cin; +using std::ifstream; CMD(rcs_import, N_("debug"), N_("RCSFILE..."), N_("parse versions in RCS files\n" @@ -41,6 +47,29 @@ CMD(cvs_import, N_("rcs"), N_("CVSROOT") } +CMD(svn_import, N_("debug"), N_("[SVNDUMP]"), + N_("import subversion repositories"), + options::opts::branch) +{ + if (args.size() > 1) + throw usage(name); + + if (args.empty()) + { + import_svn_repo(cin, app); + } + else + { + system_path in_file = system_path(idx(args, 0)); + + N(!file_exists(in_file), + F("File %s does not exist.") % in_file); + + ifstream ifs(in_file.as_external().c_str()); + import_svn_repo(ifs, app); + } +} + // Local Variables: // mode: C++ // fill-column: 76