monotone

monotone Mtn Source Tree

Root/cmd_othervcs.cc

1// Copyright (C) 2002 Graydon Hoare <graydon@pobox.com>
2//
3// This program is made available under the GNU GPL version 2.0 or
4// greater. See the accompanying file COPYING for details.
5//
6// This program is distributed WITHOUT ANY WARRANTY; without even the
7// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8// PURPOSE.
9
10#include "base.hh"
11#include "cmd.hh"
12#include "app_state.hh"
13#include "database.hh"
14#include "project.hh"
15#include "rcs_import.hh"
16#include "keys.hh"
17#include "key_store.hh"
18
19using std::vector;
20
21CMD(rcs_import, "rcs_import", "", CMD_REF(debug), N_("RCSFILE..."),
22 N_("Parses versions in RCS files"),
23 N_("This command doesn't reconstruct or import revisions. "
24 "You probably want to use cvs_import."),
25 options::opts::branch)
26{
27 if (args.size() < 1)
28 throw usage(execid);
29
30 for (args_vector::const_iterator i = args.begin();
31 i != args.end(); ++i)
32 test_parse_rcs_file(system_path((*i)()));
33}
34
35
36CMD(cvs_import, "cvs_import", "", CMD_REF(rcs), N_("CVSROOT"),
37 N_("Imports all versions in a CVS repository"),
38 "",
39 options::opts::branch)
40{
41 database db(app);
42 key_store keys(app);
43 project_t project(db);
44
45 if (args.size() != 1)
46 throw usage(execid);
47
48 N(app.opts.branchname() != "",
49 F("need base --branch argument for importing"));
50
51 system_path cvsroot(idx(args, 0)());
52 require_path_is_directory(cvsroot,
53 F("path %s does not exist") % cvsroot,
54 F("'%s' is not a directory") % cvsroot);
55
56 // make sure we can sign certs using the selected key; also requests
57 // the password (if necessary) up front rather than after some arbitrary
58 // amount of work
59 cache_user_key(app.opts, app.lua, db, keys);
60
61 import_cvs_repo(project, keys, cvsroot, app.opts.branchname);
62}
63
64
65// Local Variables:
66// mode: C++
67// fill-column: 76
68// c-file-style: "gnu"
69// indent-tabs-mode: nil
70// End:
71// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status