-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcmd_othervcs.cc
71 lines (58 loc) · 1.95 KB
/
cmd_othervcs.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright (C) 2002 Graydon Hoare <graydon@pobox.com>
//
// 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 "base.hh"
#include "cmd.hh"
#include "app_state.hh"
#include "database.hh"
#include "project.hh"
#include "rcs_import.hh"
#include "keys.hh"
#include "key_store.hh"
using std::vector;
CMD(rcs_import, "rcs_import", "", CMD_REF(debug), N_("RCSFILE..."),
N_("Parses versions in RCS files"),
N_("This command doesn't reconstruct or import revisions. "
"You probably want to use cvs_import."),
options::opts::branch)
{
if (args.size() < 1)
throw usage(execid);
for (args_vector::const_iterator i = args.begin();
i != args.end(); ++i)
test_parse_rcs_file(system_path((*i)()));
}
CMD(cvs_import, "cvs_import", "", CMD_REF(rcs), N_("CVSROOT"),
N_("Imports all versions in a CVS repository"),
"",
options::opts::branch)
{
database db(app);
key_store keys(app);
project_t project(db);
if (args.size() != 1)
throw usage(execid);
N(app.opts.branchname() != "",
F("need base --branch argument for importing"));
system_path cvsroot(idx(args, 0)());
require_path_is_directory(cvsroot,
F("path %s does not exist") % cvsroot,
F("'%s' is not a directory") % cvsroot);
// make sure we can sign certs using the selected key; also requests
// the password (if necessary) up front rather than after some arbitrary
// amount of work
cache_user_key(app.opts, app.lua, db, keys);
import_cvs_repo(project, keys, cvsroot, app.opts.branchname);
}
// 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: