#
# patch "ChangeLog"
# from [59c681975c770faad0115fb903c938dd37db4462]
# to [af0c3e167a05f44d255bc96d10a6ea6e88473b6f]
#
# patch "commands.cc"
# from [66bf9df3449b8dec9e3df3dddd4a19150cc3fc51]
# to [ae7291420f4fe4e1bd44c8ad89bca05e90322c43]
#
--- ChangeLog
+++ ChangeLog
@@ -1,5 +1,9 @@
2005-04-21 Richard Levitte
+ * commands.cc (ALIAS): refactor so you don't have to repeat all
+ the strings given to the original command.
+ (ALIAS(ci)): added as a short form for CMD(checkout).
+
* Makefile.am (%.eps): create .eps files directly from .ps files,
using ps2eps.
--- commands.cc
+++ commands.cc
@@ -234,10 +234,11 @@
void cmd_ ## C::exec(app_state & app, \
vector const & args) \
-#define ALIAS(C, realcommand, group, params, desc) \
-CMD(C, group, params, desc) \
-{ \
- process(app, string(#realcommand), args); \
+#define ALIAS(C, realcommand) \
+CMD(C, realcommand##_cmd.cmdgroup, realcommand##_cmd.params, \
+ realcommand##_cmd.desc + "\nAlias for " #realcommand) \
+{ \
+ process(app, string(#realcommand), args); \
}
static void
@@ -1779,7 +1780,7 @@
}
-CMD(checkout, "tree", "REVISION DIRECTORY\nDIRECTORY\n",
+CMD(checkout, "tree", "REVISION DIRECTORY\nDIRECTORY\n",
"check out revision from database into directory")
{
@@ -1872,8 +1873,7 @@
maybe_update_inodeprints(app);
}
-ALIAS(co, checkout, "tree", "REVISION DIRECTORY\nDIRECTORY",
- "check out revision from database; alias for checkout")
+ALIAS(co, checkout)
CMD(heads, "tree", "", "show unmerged head revisions of branch")
{
@@ -2094,7 +2094,7 @@
"unknown\n"
"ignored\n"
"missing",
- "show database objects, or the current working copy manifest, "
+ "show database objects, or the current working copy manifest,\n"
"or unknown, intentionally ignored, or missing state files")
{
if (args.size() == 0)
@@ -2127,19 +2127,7 @@
throw usage(name);
}
-ALIAS(ls, list, "informative",
- "certs ID\n"
- "keys [PATTERN]\n"
- "branches\n"
- "epochs [BRANCH [...]]\n"
- "tags\n"
- "vars [DOMAIN]\n"
- "known\n"
- "unknown\n"
- "ignored\n"
- "missing",
- "show database objects, or the current working copy manifest, "
- "or unknown, intentionally ignored, or missing state files; alias for list")
+ALIAS(ls, list)
CMD(mdelta, "packet i/o", "OLDID NEWID", "write manifest delta packet to stdout")
@@ -2806,7 +2794,9 @@
}
}
+ALIAS(ci, commit);
+
static void
dump_diffs(change_set::delta_map const & deltas,
app_state & app,