# # # patch "ChangeLog" # from [d02c1935a516c2f27d9a4d3791bc53c8643db436] # to [1053d6d9218b686c0a97634958aa656054b2e989] # # patch "cmd_ws_commit.cc" # from [b7d04c46e8220574dcaae13a78978f66e5d6da98] # to [2b8db3e6627adffc82f96048b50ffe29defb8e24] # # patch "monotone.texi" # from [50892bd3b73bfb3b07a54ebc4de67ff8b32e51d9] # to [414a511aca4ab92d13eb98af0662f95ef8d4adec] # # patch "options_list.hh" # from [00e4d40b9a6c6b0ddee6487ca89cd2967ff41dd1] # to [583180dc9e0734a39d4ef0c7a97a40ef72ec9a66] # # patch "po/sv.po" # from [b59e3c2e65045dded637a3e8cfb711a1959baa40] # to [6e4674e5156dfc7dd3315f0d4efbf84814b11a28] # # patch "tests/import/__driver__.lua" # from [262c68206019fac25d075dfa23e29572cff0d20a] # to [a3091607bf6b3fdaf6266cd844efc4412b176c2a] # ============================================================ --- ChangeLog d02c1935a516c2f27d9a4d3791bc53c8643db436 +++ ChangeLog 1053d6d9218b686c0a97634958aa656054b2e989 @@ -1,5 +1,13 @@ 2006-11-30 Richard Levitte + * cmd_ws_commit.cc (CMD_NO_WORKSPACE(import)), options_list.hh: + Implement --dry-run, locally for the import command for now. + * po/sv.po: Adjust for the added string. + * tests/import/__driver__.lua: Test it. + * monotone.texi (Tree): Document it. + +2006-11-30 Richard Levitte + * tests/import/__driver__.lua: Add a test to show that it really doesn't import a workspace. @@ -15,7 +23,7 @@ 2006-11-30 Richard Levitte ============================================================ --- cmd_ws_commit.cc b7d04c46e8220574dcaae13a78978f66e5d6da98 +++ cmd_ws_commit.cc 2b8db3e6627adffc82f96048b50ffe29defb8e24 @@ -947,7 +947,8 @@ CMD_NO_WORKSPACE(import, N_("tree"), N_( CMD_NO_WORKSPACE(import, N_("tree"), N_("DIRECTORY"), N_("import the contents of the given directory tree into a given branch"), - options::opts::branch | options::opts::revision | options::opts::message) + options::opts::branch | options::opts::revision | options::opts::message | + options::opts::dryrun) { revision_id ident; system_path dir; @@ -1025,7 +1026,8 @@ CMD_NO_WORKSPACE(import, N_("tree"), N_( app.opts.missing = false; // commit - process(app, "commit", empty_args); + if (!app.opts.dryrun) + process(app, "commit", empty_args); // clean up delete_dir_recursive(bookkeeping_root); ============================================================ --- monotone.texi 50892bd3b73bfb3b07a54ebc4de67ff8b32e51d9 +++ monotone.texi 414a511aca4ab92d13eb98af0662f95ef8d4adec @@ -4133,8 +4133,8 @@ @section Tree originally in @var{sourcebranch}, which is almost certainly not what would be intended. address@hidden mtn import address@hidden address@hidden @var{dir} address@hidden mtn import address@hidden address@hidden @var{dir} address@hidden mtn import address@hidden address@hidden [--dry-run] @var{dir} address@hidden mtn import address@hidden address@hidden [--dry-run] @var{dir} This command imports the contents of the given directory and commits it to the head of the given branch or as a child of the given revision (and consequently into the branch that revision resides in). @@ -4142,6 +4142,8 @@ @section Tree If the given branch doesn't exist, it is created automatically. If the branch already exists, any missing files are dropped and any unknown files are added before commiting. + +If @command{--dry-run} is given, no commit is done. @end ftable ============================================================ --- options_list.hh 00e4d40b9a6c6b0ddee6487ca89cd2967ff41dd1 +++ options_list.hh 583180dc9e0734a39d4ef0c7a97a40ef72ec9a66 @@ -224,6 +224,14 @@ OPTION(drop_attr, drop_attr, true, "drop } #endif +OPT(dryrun, "dry-run", bool, false, + gettext_noop("don't perform the operation, just show what would have happened")) +#ifdef option_bodies +{ + dryrun = true; +} +#endif + OPTION(globals, dump, true, "dump", gettext_noop("file to dump debugging log to, on failure")) #ifdef option_bodies ============================================================ --- po/sv.po b59e3c2e65045dded637a3e8cfb711a1959baa40 +++ po/sv.po 6e4674e5156dfc7dd3315f0d4efbf84814b11a28 @@ -146,8 +146,8 @@ msgstr "" msgstr "" "Project-Id-Version: monotone 0.26pre1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-11-30 15:44+0100\n" -"PO-Revision-Date: 2006-11-30 15:46+0100\n" +"POT-Creation-Date: 2006-11-30 21:14+0100\n" +"PO-Revision-Date: 2006-11-30 21:15+0100\n" "Last-Translator: Joel Rosdahl \n" "Language-Team: Richard Levitte \n" "MIME-Version: 1.0\n" @@ -255,7 +255,7 @@ msgstr "REVID" #: cmd_db.cc:35 cmd_diff_log.cc:386 cmd_diff_log.cc:417 cmd_diff_log.cc:419 #: cmd_files.cc:138 cmd_files.cc:197 cmd_merging.cc:125 cmd_merging.cc:677 #: cmd_merging.cc:692 cmd_merging.cc:695 cmd_ws_commit.cc:479 -#: cmd_ws_commit.cc:963 commands.cc:413 +#: cmd_ws_commit.cc:964 commands.cc:413 #, c-format msgid "no such revision '%s'" msgstr "det finns ingen revision med identiteten '%s'" @@ -1064,7 +1064,7 @@ msgstr "[ihopslagen] %s" #: cmd_merging.cc:320 cmd_merging.cc:419 cmd_merging.cc:430 cmd_merging.cc:588 #: cmd_merging.cc:821 cmd_ws_commit.cc:439 cmd_ws_commit.cc:925 -#: cmd_ws_commit.cc:948 cmd_ws_commit.cc:1034 cmd_ws_commit.cc:1048 +#: cmd_ws_commit.cc:948 cmd_ws_commit.cc:1036 cmd_ws_commit.cc:1050 msgid "tree" msgstr "träd" @@ -1616,7 +1616,7 @@ msgstr " ändrade %s" msgid " patched %s" msgstr " ändrade %s" -#: cmd_ws_commit.cc:439 cmd_ws_commit.cc:925 cmd_ws_commit.cc:1034 +#: cmd_ws_commit.cc:439 cmd_ws_commit.cc:925 cmd_ws_commit.cc:1036 msgid "[DIRECTORY]" msgstr "[KATALOG]" @@ -1632,27 +1632,27 @@ msgstr "" "kommer lövet i grenen (implicit eller angiven) att hämtas. Om\n" "ingen katalog anges kommer grenens namn att användas som katalognamn." -#: cmd_ws_commit.cc:458 cmd_ws_commit.cc:988 +#: cmd_ws_commit.cc:458 cmd_ws_commit.cc:989 #, c-format msgid "use --revision or --branch to specify what to checkout" msgstr "använd --revision eller --branch för att tala om vad som ska hämtas" -#: cmd_ws_commit.cc:466 cmd_ws_commit.cc:994 +#: cmd_ws_commit.cc:466 cmd_ws_commit.cc:995 #, c-format msgid "branch %s has multiple heads:" msgstr "grenen %s har flera löv:" -#: cmd_ws_commit.cc:469 cmd_ws_commit.cc:997 +#: cmd_ws_commit.cc:469 cmd_ws_commit.cc:998 #, c-format msgid "choose one with '%s checkout -r'" msgstr "välj en med '%s update -r'" -#: cmd_ws_commit.cc:470 cmd_ws_commit.cc:998 +#: cmd_ws_commit.cc:470 cmd_ws_commit.cc:999 #, c-format msgid "branch %s has multiple heads" msgstr "grenen %s har flera löv" -#: cmd_ws_commit.cc:497 cmd_ws_commit.cc:981 +#: cmd_ws_commit.cc:497 cmd_ws_commit.cc:982 #, c-format msgid "revision %s is not a member of branch %s" msgstr "revisionen %s är inte med i grenen %s" @@ -1787,22 +1787,22 @@ msgstr "importera innhållet av den givn msgid "import the contents of the given directory tree into a given branch" msgstr "importera innhållet av den givna katalogen till den givna grenen" -#: cmd_ws_commit.cc:956 +#: cmd_ws_commit.cc:957 #, c-format msgid "you must specify a directory to import" msgstr "du måste ange en katalog att importera" -#: cmd_ws_commit.cc:1007 +#: cmd_ws_commit.cc:1008 #, c-format msgid "import directory '%s' doesn't exists" msgstr "importkatalogen '%s' finns inte" -#: cmd_ws_commit.cc:1008 +#: cmd_ws_commit.cc:1009 #, c-format msgid "import directory '%s' is a file" msgstr "importkatalogen '%s' är en fil" -#: cmd_ws_commit.cc:1035 +#: cmd_ws_commit.cc:1037 msgid "" "migrate a workspace directory's metadata to the latest format; defaults to " "the current workspace" @@ -1810,7 +1810,7 @@ msgstr "" "migrera en arbetskopias metadata till det senaste formatet; nuvarande " "katalog avses om inget annat anges" -#: cmd_ws_commit.cc:1048 +#: cmd_ws_commit.cc:1050 msgid "refresh the inodeprint cache" msgstr "uppdatera inodeprint-cachen" @@ -3157,7 +3157,7 @@ msgstr "blockstorlek för utdata från \ msgid "block size in bytes for \"automate stdio\" output" msgstr "blockstorlek för utdata från \"automate stdio\", i antal byte" -#: options_list.hh:32 options_list.hh:309 options_list.hh:352 +#: options_list.hh:32 options_list.hh:317 options_list.hh:360 #, c-format msgid "cannot be zero or negative" msgstr "får ej vara noll eller negativt" @@ -3236,140 +3236,144 @@ msgstr "släng attribut med den givna ny msgstr "släng attribut med den givna nyckeln vid konvertering till listor" #: options_list.hh:228 +msgid "don't perform the operation, just show what would have happened" +msgstr "utför inte operationen, visa bara vad som skulle ha hänt" + +#: options_list.hh:236 msgid "file to dump debugging log to, on failure" msgstr "fil att skriva ut felsökningsloggen till om något gick fel" -#: options_list.hh:237 +#: options_list.hh:245 msgid "leave out anything described by its argument" msgstr "utelämna allt som matchar argumentet" -#: options_list.hh:245 +#: options_list.hh:253 msgid "perform the associated file operation" msgstr "genomför den tillhörande operationen på filen/filerna" -#: options_list.hh:253 +#: options_list.hh:261 msgid "print detailed version number, then exit" msgstr "skriv ut detaljerad versionsinformation och avsluta sedan omedelbart" -#: options_list.hh:260 +#: options_list.hh:268 msgid "display help message" msgstr "skriv ut extra hjälptext" -#: options_list.hh:269 +#: options_list.hh:277 msgid "include anything described by its argument" msgstr "ta med allt allt som matchar argumentet" -#: options_list.hh:277 +#: options_list.hh:285 msgid "set key for signatures" msgstr "ange nyckel att signera med" -#: options_list.hh:285 +#: options_list.hh:293 msgid "set location of key store" msgstr "ange i vilken katalog nycklarna finns" -#: options_list.hh:294 +#: options_list.hh:302 msgid "push the specified key even if it hasn't signed anything" msgstr "skicka med angiven nyckel även om den inte använts för att signera" -#: options_list.hh:304 +#: options_list.hh:312 msgid "limit log output to the last number of entries" msgstr "begränsa loggutskriften till detta antal poster bakåt i tiden" -#: options_list.hh:313 +#: options_list.hh:321 msgid "file to write the log to" msgstr "fil att skriva ut loggen till" -#: options_list.hh:324 +#: options_list.hh:332 msgid "set commit changelog message" msgstr "ange loggmeddelandet för arkivering" -#: options_list.hh:331 +#: options_list.hh:339 msgid "set filename containing commit changelog message" msgstr "ange filnamnet som innehåller loggmeddelandet för arkivering" -#: options_list.hh:339 +#: options_list.hh:347 msgid "perform the operations for files missing from workspace" msgstr "genomför operationen på filer som saknas i arbetskatalogen" -#: options_list.hh:347 +#: options_list.hh:355 msgid "limit log output to the next number of entries" msgstr "begränsa loggutskriften till detta antal poster framåt i tiden" -#: options_list.hh:357 +#: options_list.hh:365 msgid "exclude files when printing logs" msgstr "" "ta ej med vilka filer som lagts till, tagits bort eller ändrats i loggen" -#: options_list.hh:365 +#: options_list.hh:373 msgid "do not ignore any files" msgstr "ignorera inga filer" -#: options_list.hh:373 +#: options_list.hh:381 msgid "exclude merges when printing logs" msgstr "ta ej med ihopslagningar i loggen" -#: options_list.hh:381 +#: options_list.hh:389 msgid "do not load ~/.monotone/monotonerc or _MTN/monotonerc lua files" msgstr "använd inte ~/.monotone/monotonerc eller _MTN/monotonerc" -#: options_list.hh:389 +#: options_list.hh:397 msgid "do not load standard lua hooks" msgstr "använd inte standard-lua-rutinerna" -#: options_list.hh:397 +#: options_list.hh:405 msgid "record process id of server" msgstr "spara serverns process-ID i denna fil" -#: options_list.hh:405 +#: options_list.hh:413 msgid "suppress verbose, informational and progress messages" msgstr "skriv inte ut informations- eller förloppsmeddelanden" -#: options_list.hh:415 +#: options_list.hh:423 msgid "load extra rc file" msgstr "använd denna lua-fil" -#: options_list.hh:423 +#: options_list.hh:431 msgid "suppress warning, verbose, informational and progress messages" msgstr "skriv inte ut varningar eller informations- eller förloppsmeddelanden" -#: options_list.hh:433 +#: options_list.hh:441 msgid "also operate on the contents of any listed directories" msgstr "ta även med innehållet för varje listad katalog" -#: options_list.hh:442 +#: options_list.hh:450 msgid "select revision id for operation" msgstr "ange den revision som operationen ska utföras på" -#: options_list.hh:450 +#: options_list.hh:458 msgid "limit search for workspace to specified root" msgstr "begränsa sökningen efter arbetskopian till denna katalog" -#: options_list.hh:458 +#: options_list.hh:466 msgid "use the current arguments as the future default" msgstr "använd de givna argumenten som framtida standardvärden" -#: options_list.hh:466 +#: options_list.hh:474 msgid "set ticker style (count|dot|none)" msgstr "sätt stilen för förloppsinformationen (count|dot|none)" -#: options_list.hh:477 +#: options_list.hh:485 #, c-format msgid "argument must be 'none', 'dot', or 'count'" msgstr "argumentet måste vara 'none', 'dot' eller 'count'" -#: options_list.hh:482 +#: options_list.hh:490 msgid "perform the operations for unknown files from workspace" msgstr "genomför operationen på okända filer i arbetskatalogen" -#: options_list.hh:490 +#: options_list.hh:498 msgid "verbose completion output" msgstr "ge utförlig information" -#: options_list.hh:498 +#: options_list.hh:506 msgid "print version number, then exit" msgstr "skriv ut versionsnumret och avsluta sedan omedelbart" -#: options_list.hh:506 +#: options_list.hh:514 msgid "insert command line arguments taken from the given file" msgstr "använd kommandoradsargument ur denna fil" ============================================================ --- tests/import/__driver__.lua 262c68206019fac25d075dfa23e29572cff0d20a +++ tests/import/__driver__.lua a3091607bf6b3fdaf6266cd844efc4412b176c2a @@ -108,3 +108,12 @@ check(mtn("import", "exportdir2", check(mtn("import", "exportdir2", "--message", "Import seven, trying to import a workspace", "--branch", "importbranch"), 1, false, false) + +------------------------------------------------------------------------------ +-- Eight attempt, this time just doing a dry run. +remove("importdir/importmethird") +check(mtn("import", "importdir", + "--dry-run", + "--message", "Import eight, dry run so shouldn't commit", + "--branch", "importbranch"), 0, false, true) +check(not qgrep("committed revision ", "stderr"))