[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-commits-diffs] net.venge.monotone: e0d65e6639c5596e1f01ca5d4c
From: |
code |
Subject: |
[Monotone-commits-diffs] net.venge.monotone: e0d65e6639c5596e1f01ca5d4c74420eeb3d8e32 |
Date: |
Sun, 23 Jan 2011 18:05:23 GMT |
revision: e0d65e6639c5596e1f01ca5d4c74420eeb3d8e32
date: 2011-01-23T18:04:28
author: Richard Levitte <address@hidden>
branch: net.venge.monotone
changelog:
merge of '1da4faa048851ffc49d678f023ce41526a537af9'
and '60a84b68c89b87c949cdd8af175f0e14cb119610'
manifest:
format_version "1"
new_manifest [9ffe66f1310f6a0c45ee790f29b9938237b1382e]
old_revision [1da4faa048851ffc49d678f023ce41526a537af9]
patch "monotone.texi"
from [4f64ca94db9ee9221dd674961f24706bb62e0eee]
to [3040c7788d469070bb0fd97cbdce2ec7664c000a]
patch "options_list.hh"
from [1985a3326ea833595edf84b75ae5ab9fde487709]
to [548a7192e2a4dd39d69fd33d13cc0e28d6f09c26]
old_revision [60a84b68c89b87c949cdd8af175f0e14cb119610]
patch "cmd_key_cert.cc"
from [0b6074acdf9014b625369a976da51ce3677e0630]
to [071b47b387bf2b8bc33839765e8056f378bc3d81]
patch "cmd_list.cc"
from [1761568b06cf3afa752a2e6d1611b450cbfae6c4]
to [d5f1d76cb76151d303cda19a974fe5c86f806d70]
patch "cmd_packet.cc"
from [31321e792e77dd18121f7689413777c23045537a]
to [672156d0fefaa0b7ec02795871573a0e4057b89b]
patch "database.cc"
from [ecdc5c4bc826e966f06d310e35115e41f783df92]
to [1ca31c776dd4882e3c783f80dbc20e351e5fd908]
patch "database.hh"
from [18a9504000bb0856b693577e3de47861d7a7f5e0]
to [66798497f77bc1010b7e5850d2c406eaf1010b2e]
patch "tests/key_management_without_a_database/__driver__.lua"
from [87ef58d870b76fa10441e6f47654e93b794cebb8]
to [6f6dccf171baf344b914fdef614ac3856ee792dd]
============================================================
--- monotone.texi 4f64ca94db9ee9221dd674961f24706bb62e0eee
+++ monotone.texi 3040c7788d469070bb0fd97cbdce2ec7664c000a
@@ -77,7 +77,6 @@ @top Overview
* Concepts:: Taxonomy of monotone
* Tutorial:: A detailed example of using monotone
* Advanced Uses:: Going beyond the basics
-* CVS Phrasebook:: Transitional guide for CVS users
* Command Reference:: Details of each monotone command
* Formats:: Formats used by monotone and scripts
* Lua Reference:: How Lua is integrated in monotone
@@ -2662,7 +2661,7 @@ @section Network Service Revisited
content arrived in your database.
@end itemize
address@hidden Advanced Uses, CVS Phrasebook, Tutorial, Top
address@hidden Advanced Uses, Command Reference, Tutorial, Top
@chapter Advanced Uses
This chapter covers slightly less common aspects of using
@@ -4538,356 +4537,7 @@ @section Bisecting
command also removes all stored bisection information in preparation
for future bisect operations.
address@hidden
address@hidden CVS Phrasebook, Command Reference, Advanced Uses, Top
address@hidden CVS Phrasebook
-
-This chapter translates common CVS commands into monotone commands. It
-is an easy alternative to reading through the complete command
-reference.
-
address@hidden Checking Out a Tree
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ CVSROOT=:pserver:cvs.foo.com/wobbler
-$ cvs -d $CVSROOT checkout -r 1.2
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn pull "mtn://www.foo.com?com.foo.wobbler*"
-$ mtn checkout --revision=fe37 wobbler
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-The CVS command contacts a network server, retrieves a revision, and
-stores it in your workspace. There are two cosmetic differences
-with the monotone command: remote databases are specified by hostnames
-and globs, and revisions are denoted by @sc{sha1} values (or
-selectors).
-
-There is also one deep difference: pulling revisions into your
-database is a separate step from checking out a single revision; after
-you have pulled from a network server, your database will contain
address@hidden revisions, possibly the entire history of a
-project. Checking out is a separate step, after communication, which
-only copies a particular revision out of your database and into a named
-directory.
-
address@hidden Committing Changes
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ cvs commit -m "log message"
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn commit --message="log message"
-$ mtn push "mtn://www.foo.com?com.foo.wobbler*"
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-As with other networking commands, the communication step with
-monotone is explicit: committing changes only saves them to the local
-database. A separate command, @command{push}, sends the changes to a
-remote database.
-
address@hidden Undoing Changes
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ cvs update -C file
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn revert file
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-Unlike CVS, monotone includes a separate @command{revert} command for
-undoing local changes and restoring the workspace to the original
-contents of the base revision. Because this can be dangerous,
address@hidden insists on an explicit argument to name the files or
-directories to be reverted; use the current directory "@file{.}" at the
-top of the workspace to revert everything. The @command{revert} command
-is also used to restore deleted files (with a convenient
address@hidden option for naming these files).
-
-In CVS, you would need to use @command{update} to restore missing or
-changed files, and you might get back a newer version of the file than
-you started with. In monotone, @command{revert} always takes you back to
-where you started, and the @command{update} command is only used to move
-the workspace to a different (usually newer) base revision.
-
-
address@hidden Incorporating New Changes
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ cvs update -d
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn pull "mtn://www.foo.com?com.foo.wobbler*"
-$ mtn merge
-$ mtn update
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-This command, like other networking commands, involves a separate
-communication step with monotone. The extra command, @command{merge},
-ensures that the branch your are working on has a unique head. You can
-omit the @command{merge} step if you only want @command{update} to
-examine descendants of your base revision, and ignore other heads on
-your branch.
-
-
address@hidden Tagging Revisions
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ cvs tag FOO_TAG .
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn tag h: FOO_TAG
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-With CVS, tags are placed on individual files, and the closest thing to
-identifying a consistent repository-wide revision is a set of files with
-the same tag. In monotone, all changes are part of a repository-wide
-revision, and some of those revisions may be tagged. Monotone has no
-partial tags that apply only to a subset of files.
-
-
address@hidden Moving Workspace to Another Revision
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ cvs update -r FOO_TAG -d
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn update -r 830ac1a5f033825ab364f911608ec294fe37f7bc
-$ mtn update -r t:FOO_TAG
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-With a revision parameter, the @command{update} command operates
-similarly in monotone and CVS. One difference is that a subsequent
address@hidden will be based off the chosen revision in monotone,
-while a @command{commit} in the CVS case is not possible without going
-back to the branch head again. This version of @command{update} can
-thus be very useful if, for example, you discover that the tree you are
-working against is somehow broken --- you can @command{update} to an
-older non-broken version, and continue to work normally while waiting
-for the tree to be fixed.
-
address@hidden Viewing Differences
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ cvs diff
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn diff
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ cvs diff -r 1.2 -r 1.4 myfile
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn diff -r 3e7db -r 278df myfile
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-Monotone's @command{diff} command is modeled on that of CVS, so the
-main features are the same: @command{diff} alone prints the
-differences between your workspace and its base revision, whereas
address@hidden accompanied by two revision numbers prints the
-difference between those two revisions. The major difference between
-CVS and monotone here is that monotone's revision numbers are
address@hidden IDs}, rather than file IDs. If one leaves off the file
-argument, then diff can print the difference between two entire trees.
-
address@hidden Showing Workspace Status
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ cvs status
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn status
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-This command operates similarly in monotone and CVS. The only major
-difference is that monotone's @command{status} command always gives a
-status of the whole tree, and outputs a more compact summary than CVS.
-
address@hidden Adding Directories and Files to Workspace
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ cvs add dir
-$ cvs add dir/subdir
-$ cvs add dir/subdir/file.txt
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn add dir/subdir/file.txt
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-Monotone does not explicitly store directories, so adding a file only
-involves adding the file's complete path, including any directories.
-Directories are created as needed, and empty directories are ignored.
-
-
address@hidden Removing Directories and Files from Workspace
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ rm file.txt
-$ cvs remove file.txt
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn drop file.txt
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-Monotone does not require that you erase a file from the workspace
-before you drop it. Dropping a file both removes its entry in the
-manifest of the current revision and removes it from the filesystem.
-
-
address@hidden Viewing History
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ cvs log [file]
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn log [file]
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-Unlike CVS log, monotone log can also be used without a workspace; but
-in this case you must pass a @option{--from} revision argument to tell
-monotone where to start displaying the log from.
-
address@hidden Importing a New Project
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ cvs import wobbler vendor start
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn --db=/path/to/database.mtn --branch=com.foo.wobbler setup .
-$ mtn add -R .
-$ mtn commit
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-The @command{setup} command turns an ordinary directory into a
-monotone workspace. After that, you can add your files and commit
-them as usual.
-
address@hidden Initializing a Repository
-
address@hidden @columnfractions .4 .4
address@hidden
address@hidden
address@hidden
-$ cvs init -d /path/to/repository
address@hidden group
address@hidden smallexample
address@hidden
address@hidden
address@hidden
-$ mtn db init --db=/path/to/database.mtn
address@hidden group
address@hidden smallexample
address@hidden multitable
-
-Monotone's ``repository'' is a single-file database, which is created
-and initialized by this command. This file is only ever used by you,
-and does not need to be in any special location, or readable by other
-users.
-
-
address@hidden Command Reference, Formats, CVS Phrasebook, Top
address@hidden Command Reference, Formats, Advanced Uses, Top
@chapter Command Reference
Monotone has a large number of commands. To help navigate through them
@@ -11471,7 +11121,6 @@ @section Hooks
* Attribute Handling::
* GIT Export Hooks::
* Validation Hooks::
-* Meta Hooks::
@end menu
@node Common Data Types, Event Notifications and Triggers, Hooks, Hooks
@@ -12676,7 +12325,7 @@ @subsection GIT Export Hooks
@end ftable
address@hidden Validation Hooks, Meta Hooks, GIT Export Hooks, Hooks
address@hidden Validation Hooks, , GIT Export Hooks, Hooks
@subsection Validation Hooks
If there is a policy decision to make, Monotone defines certain hooks to
@@ -12716,27 +12365,6 @@ @subsection Validation Hooks
@end ftable
address@hidden Meta Hooks, , Validation Hooks, Hooks
address@hidden Meta Hooks
-
-Monotone allows the execution of arbitrary Lua hooks and functions through a
-special generalized "meta hook". See @address@hidden automate lua}} for more
-information.
-
address@hidden @code
address@hidden hook_wrapper (@var{func_name}, @var{...})
-
-This hook is called on every execution of @address@hidden automate
-lua}}.
-
-The default definition takes a function name and zero or more string
-function arguments which are evaluated into a Lua function call. It
-returns a dump of the return value of the called function.
-
-There is very little reason for a user to redefine this function.
-
address@hidden ftable
-
@page
@node Additional Lua Functions, Implementation Differences, Hooks, Lua Reference
@section Additional Lua Functions
@@ -13155,9 +12783,7 @@ @heading General Terms
console (IDNA names are ASCII, which is a subset of UTF-8, so this
normal form conversion can still apply, albeit oddly). this behavior
is to protect users against security problems associated with
-malicious use of "similar-looking" characters. If the hook
address@hidden returns true, IDNA names are decoded for
-display.
+malicious use of "similar-looking" characters.
@end table
============================================================
--- options_list.hh 1985a3326ea833595edf84b75ae5ab9fde487709
+++ options_list.hh 548a7192e2a4dd39d69fd33d13cc0e28d6f09c26
@@ -217,8 +217,8 @@ SIMPLE_OPTION(auto_update, "update/no-up
gettext_noop("block size in bytes for \"automate stdio\" output"))
SIMPLE_OPTION(auto_update, "update/no-update", bool,
- gettext_noop("automatically update the workspace, if it is clean and the base "
- "revision is a head of an affected branch"))
+ gettext_noop("automatically update the workspace, if it was at a head and the"
+ "command creates a new head"))
OPTSET(bind_opts)
GROUPED_SIMPLE_OPTION(bind_opts, bind_uris, "bind", std::vector<utf8>,
============================================================
--- database.cc ecdc5c4bc826e966f06d310e35115e41f783df92
+++ database.cc 1ca31c776dd4882e3c783f80dbc20e351e5fd908
@@ -509,14 +509,14 @@ database_cache database::dbcache;
database_cache database::dbcache;
-database::database(app_state & app)
- : opts(app.opts), lua(app.lua)
+database::database(app_state & app, database::dboptions d)
+ : opts(app.opts), lua(app.lua), dbopts(d)
{
init();
}
-database::database(options const & o, lua_hooks & l)
- : opts(o), lua(l)
+database::database(options const & o, lua_hooks & l, database::dboptions d)
+ : opts(o), lua(l), dbopts(d)
{
init();
}
@@ -526,7 +526,7 @@ database::init()
{
database_path_helper helper(lua);
system_path dbpath;
- helper.get_database_path(opts, dbpath);
+ helper.get_database_path(opts, dbpath, dbopts);
// FIXME: for all :memory: databases an empty path is returned above, thus
// all requests for a :memory: database point to the same database
@@ -4930,13 +4930,20 @@ void
}
void
-database_path_helper::get_database_path(options const & opts, system_path & path)
+database_path_helper::get_database_path(options const & opts,
+ system_path & path,
+ database::dboptions dbopts)
{
if (!opts.dbname_given ||
(opts.dbname.as_internal().empty() &&
opts.dbname_alias.empty() &&
opts.dbname_type != memory_db))
{
+ if (dbopts == database::maybe_unspecified)
+ {
+ L(FL("no database option given or options empty"));
+ return;
+ }
E(false, origin::user, F("no database specified"));
}
============================================================
--- database.hh 18a9504000bb0856b693577e3de47861d7a7f5e0
+++ database.hh 66798497f77bc1010b7e5850d2c406eaf1010b2e
@@ -87,8 +87,11 @@ public:
// --== Opening the database and schema checking ==--
//
public:
- explicit database(app_state & app);
- database(options const & o, lua_hooks & l);
+ // database options
+ typedef enum { none, maybe_unspecified } dboptions;
+
+ explicit database(app_state & app, dboptions dbopts = none);
+ database(options const & o, lua_hooks & l, dboptions dbopts = none);
~database();
system_path get_filename();
@@ -499,6 +502,7 @@ private:
boost::shared_ptr<database_impl> imp;
options opts;
lua_hooks & lua;
+ dboptions dbopts;
};
// not a member function, defined in database_check.cc
@@ -607,7 +611,8 @@ public:
public:
database_path_helper(lua_hooks & l) : lua(l) {}
- void get_database_path(options const & opts, system_path & path);
+ void get_database_path(options const & opts, system_path & path,
+ database::dboptions dbopts = database::none);
void maybe_set_default_alias(options & opts);
============================================================
--- cmd_key_cert.cc 0b6074acdf9014b625369a976da51ce3677e0630
+++ cmd_key_cert.cc 071b47b387bf2b8bc33839765e8056f378bc3d81
@@ -47,7 +47,7 @@ CMD(genkey, "genkey", "", CMD_REF(key_an
"",
options::opts::force_duplicate_key)
{
- database db(app);
+ database db(app, database::maybe_unspecified);
key_store keys(app);
if (args.size() != 1)
@@ -80,7 +80,7 @@ CMD_AUTOMATE(generate_key, N_("KEY_NAME
E(args.size() == 2, origin::user,
F("wrong argument count"));
- database db(app);
+ database db(app, database::maybe_unspecified);
key_store keys(app);
key_name name = typecast_vocab<key_name>(idx(args, 0));
@@ -124,7 +124,7 @@ dropkey_common(app_state & app,
args_vector args,
bool drop_private)
{
- database db(app);
+ database db(app, database::maybe_unspecified);
key_store keys(app);
bool key_deleted = false;
bool checked_db = false;
@@ -198,7 +198,7 @@ CMD(passphrase, "passphrase", "", CMD_RE
throw usage(execid);
key_store keys(app);
- database db(app);
+ database db(app, database::maybe_unspecified);
project_t project(db);
key_identity_info identity;
@@ -216,7 +216,7 @@ CMD(ssh_agent_export, "ssh_agent_export"
"",
options::opts::none)
{
- database db(app);
+ database db(app, database::maybe_unspecified);
key_store keys(app);
project_t project(db);
@@ -244,7 +244,7 @@ CMD(ssh_agent_add, "ssh_agent_add", "",
"",
options::opts::none)
{
- database db(app);
+ database db(app, database::maybe_unspecified);
key_store keys(app);
project_t project(db);
============================================================
--- cmd_list.cc 1761568b06cf3afa752a2e6d1611b450cbfae6c4
+++ cmd_list.cc d5f1d76cb76151d303cda19a974fe5c86f806d70
@@ -359,7 +359,7 @@ CMD(keys, "keys", "", CMD_REF(list), "[P
if (args.size() > 1)
throw usage(execid);
- database db(app);
+ database db(app, database::maybe_unspecified);
key_store keys(app);
project_t project(db);
@@ -961,7 +961,7 @@ CMD_AUTOMATE(keys, "",
E(args.empty(), origin::user,
F("no arguments needed"));
- database db(app);
+ database db(app, database::maybe_unspecified);
key_store keys(app);
project_t project(db);
============================================================
--- cmd_packet.cc 31321e792e77dd18121f7689413777c23045537a
+++ cmd_packet.cc 672156d0fefaa0b7ec02795871573a0e4057b89b
@@ -85,7 +85,7 @@ pubkey_common(app_state & app,
args_vector args,
std::ostream & output)
{
- database db(app);
+ database db(app, database::maybe_unspecified);
key_store keys(app);
project_t project(db);
@@ -141,7 +141,7 @@ CMD(privkey, "privkey", "", CMD_REF(pack
"",
options::opts::none)
{
- database db(app);
+ database db(app, database::maybe_unspecified);
key_store keys(app);
project_t project(db);
============================================================
--- tests/key_management_without_a_database/__driver__.lua 87ef58d870b76fa10441e6f47654e93b794cebb8
+++ tests/key_management_without_a_database/__driver__.lua 6f6dccf171baf344b914fdef614ac3856ee792dd
@@ -2,17 +2,42 @@ mtn_setup()
mtn_setup()
-- with no database should work
-check(raw_mtn("--keydir=keys", "genkey", "foobar"), 0, false, false,
+check(raw_mtn("--keydir=keys", "--no-workspace",
+ "genkey", "foobar"), 0, false, false,
string.rep("foobar\n", 2))
-check(raw_mtn("--keydir=keys", "passphrase", "foobar"), 0, false, false,
+check(raw_mtn("--keydir=keys", "--no-workspace",
+ "passphrase", "foobar"), 0, false, false,
"foobar\n"..string.rep("barfoo\n", 2))
-check(raw_mtn("--keydir=keys", "ls", "keys"), 0, false, false)
+check(raw_mtn("--keydir=keys", "--no-workspace",
+ "ls", "keys"), 0, false, false)
-check(raw_mtn("--keydir=keys", "pubkey", "foobar"), 0, false, false)
+check(raw_mtn("--keydir=keys", "--no-workspace",
+ "pubkey", "foobar"), 0, false, false)
-check(raw_mtn("--keydir=keys", "dropkey", "foobar"), 0, false, false)
+check(raw_mtn("--keydir=keys", "--no-workspace",
+ "privkey", "foobar"), 0, false, false)
+check(raw_mtn("--keydir=keys", "--no-workspace",
+ "ssh_agent_export", "--key", "foobar"), 0, false, false,
+ "barfoo\n")
+
+check(raw_mtn("--keydir=keys", "--no-workspace",
+ "dropkey", "foobar"), 0, false, false)
+
+-- now with the automate interface
+check(raw_mtn("--keydir=keys", "--no-workspace",
+ "au", "generate_key", "foobar", "foobar"), 0, false, false)
+
+check(raw_mtn("--keydir=keys", "--no-workspace",
+ "au", "keys"), 0, false, false)
+
+check(raw_mtn("--keydir=keys", "--no-workspace",
+ "au", "get_public_key", "foobar"), 0, false, false)
+
+check(raw_mtn("--keydir=keys", "--no-workspace",
+ "dropkey", "foobar"), 0, false, false)
+
-- with an invalid database should fail
check(raw_mtn("--keydir=keys", "--db=bork", "genkey", "address@hidden"), 1, false, false, string.rep("address@hidden", 2))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Monotone-commits-diffs] net.venge.monotone: e0d65e6639c5596e1f01ca5d4c74420eeb3d8e32,
code <=