#
# patch "ChangeLog"
# from [4ffb3e98f5bba9ddd2e68e63059e4fde39c1765c]
# to [f0d8ffc9ccb6be9ec283db3d0e30856e492a345b]
#
# patch "app_state.cc"
# from [cc0de5fca6542f8df529f9232a06ffe32f8b5366]
# to [55940bbedb7b512fe7356718d0bf55231e259eaa]
#
# patch "app_state.hh"
# from [e635a3561b1ac5c00aa5f443ff98d95b17134f3d]
# to [722089b1d9fdd1d1b80a16947b9ff41264abfbab]
#
# patch "commands.cc"
# from [002c7e8b171019ed9c19cb1f15dcfebdec5c1257]
# to [21dc5df38202f2ea2b779d94bba1e826513d6043]
#
# patch "monotone.cc"
# from [8cb7a023798adb3cfe759d2030151cba793fa733]
# to [1ffec0fe089435af99fa611b29348545ddb1a3fd]
#
# patch "monotone.texi"
# from [d78e0943f6472cdf45ffe79e195340e2ecf78f7f]
# to [798a0e6c14510009362f2aa06a51ce6de6471906]
#
# patch "options.hh"
# from [7d90588b90ca771e06d433e2649d766690b2ed31]
# to [c816cba7161e7f08ba376b73b8139c2265f5a2ae]
#
========================================================================
--- ChangeLog 4ffb3e98f5bba9ddd2e68e63059e4fde39c1765c
+++ ChangeLog f0d8ffc9ccb6be9ec283db3d0e30856e492a345b
@@ -1,3 +1,8 @@
+2005-11-15 Nathaniel Smith
+
+ * commands.cc (setup): Rename to 'new_project'. Add alias for
+ 'setup', so it still works.
+
2005-11-14 Nathaniel Smith
* monotone.texi (Historical records): Clarify wording, based on
========================================================================
--- app_state.cc cc0de5fca6542f8df529f9232a06ffe32f8b5366
+++ app_state.cc 55940bbedb7b512fe7356718d0bf55231e259eaa
@@ -40,7 +40,8 @@
depth(-1), last(-1), diff_format(unified_diff), diff_args_provided(false),
use_lca(false), execute(false), bind_address(""), bind_port(""),
missing(false), unknown(false),
- confdir(system_path(get_homedir()) / ".monotone"), have_set_key_dir(false)
+ confdir(system_path(get_homedir()) / ".monotone"), have_set_key_dir(false),
+ new_db(false)
{
db.set_app(this);
lua.set_app(this);
========================================================================
--- app_state.hh e635a3561b1ac5c00aa5f443ff98d95b17134f3d
+++ app_state.hh 722089b1d9fdd1d1b80a16947b9ff41264abfbab
@@ -69,6 +69,7 @@
std::vector keys_to_push;
system_path confdir;
bool have_set_key_dir;
+ bool new_db;
std::map explicit_option_map; // set if the value of the flag was explicitly given on the command line
void set_is_explicit_option (int option_id);
========================================================================
--- commands.cc 002c7e8b171019ed9c19cb1f15dcfebdec5c1257
+++ commands.cc 21dc5df38202f2ea2b779d94bba1e826513d6043
@@ -2074,11 +2074,14 @@
CMD(pull, N_("network"), N_("[ADDRESS[:PORTNUMBER] [PATTERN]]"),
N_("pull branches matching PATTERN from netsync server at ADDRESS"),
- OPT_SET_DEFAULT % OPT_EXCLUDE)
+ OPT_SET_DEFAULT % OPT_EXCLUDE % OPT_NEW_DB)
{
utf8 addr, include_pattern, exclude_pattern;
process_netsync_args(name, args, addr, include_pattern, exclude_pattern, true, false, app);
+ if (app.new_db)
+ app.db.initialize();
+
if (app.signing_key() == "")
P(F("doing anonymous pull; use -kKEYNAME if you need authentication\n"));
@@ -3777,13 +3780,15 @@
}
}
-CMD(setup, N_("tree"), N_("DIRECTORY"), N_("setup a new working copy directory"),
- OPT_BRANCH_NAME)
+CMD(new_project, N_("tree"), N_("DIRECTORY"), N_("setup a new working copy directory"),
+ OPT_BRANCH_NAME % OPT_NEW_DB)
{
if (args.size() != 1)
throw usage(name);
- N(!app.branch_name().empty(), F("need --branch argument for setup"));
+ N(!app.branch_name().empty(), F("please use --branch to name your project"));
+ if (app.new_db)
+ app.db.initialize();
app.db.ensure_open();
string dir = idx(args,0)();
@@ -3792,6 +3797,8 @@
put_revision_id(null);
}
+ALIAS(setup, new_project)
+
CMD(automate, N_("automation"),
N_("interface_version\n"
"heads [BRANCH]\n"
========================================================================
--- monotone.cc 8cb7a023798adb3cfe759d2030151cba793fa733
+++ monotone.cc 1ffec0fe089435af99fa611b29348545ddb1a3fd
@@ -73,6 +73,7 @@
{"missing", 0, POPT_ARG_NONE, NULL, OPT_MISSING, gettext_noop("perform the operations for files missing from working directory"), NULL},
{"unknown", 0, POPT_ARG_NONE, NULL, OPT_UNKNOWN, gettext_noop("perform the operations for unknown files from working directory"), NULL},
{"key-to-push", 0, POPT_ARG_STRING, &argstr, OPT_KEY_TO_PUSH, gettext_noop("push the specified key even if it hasn't signed anything"), NULL},
+ {"new-db", 0, POPT_ARG_NONE, NULL, OPT_NEW_DB, gettext_noop("create a new local database"), NULL},
{ NULL, 0, 0, NULL, 0, NULL, NULL }
};
@@ -485,6 +486,10 @@
}
break;
+ case OPT_NEW_DB:
+ app.new_db = true;
+ break;
+
case OPT_HELP:
default:
requested_help = true;
========================================================================
--- monotone.texi d78e0943f6472cdf45ffe79e195340e2ecf78f7f
+++ monotone.texi 798a0e6c14510009362f2aa06a51ce6de6471906
@@ -1094,49 +1094,6 @@
@page
address@hidden Creating a Database
address@hidden Creating a Database
-
-The first step Jim, Abe and Beth each need to perform is to create a
-new database. This is done with the @code{monotone db init} command,
-providing a @option{--db} option to specify the location of the new
-database. Each programmer creates their own database, which will
-reside in their home directory and store all the revisions, files and
-manifests they work on. Monotone requires this step as an explicit
-command, to prevent spurious creation of databases when an invalid
address@hidden option is given.
-
-In real life, most people prefer to keep one database for each project
-they work on. If we followed that convention here in the tutorial,
-though, then all the databases would be called @code{juicebot.db}, and
-that would make things more confusing to read. So instead, we'll have
-them each name their database after themselves.
-
-Thus Jim issues the command:
-
address@hidden
address@hidden
-$ monotone db init --db=~/jim.db
address@hidden group
address@hidden smallexample
-
-Abe issues the command:
-
address@hidden
address@hidden
-$ monotone db init --db=~/abe.db
address@hidden group
address@hidden smallexample
-
-And Beth issues the command:
-
address@hidden
address@hidden
-$ monotone db init --db=~/beth.db
address@hidden group
address@hidden smallexample
-
address@hidden
@node Generating Keys
@section Generating Keys
@@ -1243,12 +1200,13 @@
@section Starting a New Project
Before he can begin work on the project, Jim needs to create a
address@hidden copy} --- a directory whose contents monotone will keep track
-of. Often, one works on projects that someone else has started, and
-creates working copies with the @code{checkout} command, which you'll
-learn about later. Jim is starting a new project, though, so he does
-something a little bit different. He uses the @code{monotone setup}
-command to create a new working copy.
address@hidden directory} --- a directory whose contents monotone will keep
+track of. Often, one works on projects that someone else has started,
+and creates working directories with the @code{checkout} command, which
+you'll learn about later. Jim is starting a new project, though, that
+monotone has never seen before, so he does something a little bit
+different. He uses the @code{monotone new_project} command to create
+new working directory.
This command creates the named directory (if it doesn't already exist),
and creates the @file{MT} directory within it. The @file{MT} directory
========================================================================
--- options.hh 7d90588b90ca771e06d433e2649d766690b2ed31
+++ options.hh c816cba7161e7f08ba376b73b8139c2265f5a2ae
@@ -49,3 +49,4 @@
#define OPT_UNKNOWN 40
#define OPT_KEY_TO_PUSH 41
#define OPT_CONF_DIR 42
+#define OPT_NEW_DB 43