Hi,

The following two patches are two possible responses to the bug John
Goerzen pointed out, which is that --summary is ignored in push/pull/send
unless --dry-run is also given.  One option would simply be to document
that --summary only has an effect if dry-run is given.  But perhaps a
better response would be to add a patch summary when --all is given, which
is another patch.  But --summary doesn't make any sense for interactive
push/pull/send as far as I can tell.

Any opinions as to which solution we should go with, or if there's another
better plan?

David

Sun Sep  4 08:54:34 EDT 2005  David Roundy <[EMAIL PROTECTED]>
  * Make print_dry_run_message_and_exit print summaries if All and Summary.
  This is a somewhat hokey way to make --all --summary print summary
  messages.

Sun Sep  4 08:30:40 EDT 2005  David Roundy <[EMAIL PROTECTED]>
  * improve help message for summary in send/pull/push.
  For these commands, --summary only has an effect if --dry-run is also
  given.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


New patches:

[Make print_dry_run_message_and_exit print summaries if All and Summary.
David Roundy <[EMAIL PROTECTED]>**20050904125434
 This is a somewhat hokey way to make --all --summary print summary
 messages.
] 
<
> {
hunk ./DarcsArguments.lhs 763
 
 print_dry_run_message_and_exit :: String -> [DarcsFlag] -> [Patch] -> IO ()
 print_dry_run_message_and_exit action opts patches =
- -  when (DryRun `elem` opts) $ do
- -    let showpatch p = if Verbose `elem` opts
- -                      then (human_friendly $ fromJust $ patch2patchinfo p)
- -                        $$ showUnnamed p
- -                      else if Summary `elem` opts
- -                      then (human_friendly $ fromJust $ patch2patchinfo p)
- -                        $$ patch_summary p
- -                      else human_friendly $ fromJust $ patch2patchinfo p
- -    putDocLn $ text ("Would " ++ action ++ " the following changes:")
- -            $$ (vsep $ map showpatch patches)
- -    putStrLn ""
- -    putStrLn "Making no changes:  this is a dry run."
- -    exitWith ExitSuccess
+  let showpatch p = if Verbose `elem` opts
+                    then (human_friendly $ fromJust $ patch2patchinfo p)
+                      $$ showUnnamed p
+                    else if Summary `elem` opts
+                    then (human_friendly $ fromJust $ patch2patchinfo p)
+                      $$ patch_summary p
+                    else human_friendly $ fromJust $ patch2patchinfo p
+  in do when (DryRun `elem` opts) $ do
+          putDocLn $ text ("Would " ++ action ++ " the following changes:")
+              $$ (vsep $ map showpatch patches)
+          putStrLn ""
+          putStrLn "Making no changes:  this is a dry run."
+          exitWith ExitSuccess
+        when (All `elem` opts && Summary `elem` opts) $
+          putDocLn $ text ("Will " ++ action ++ " the following changes:")
+              $$ (vsep $ map showpatch patches)
 \end{code}
 
 \input{Resolution.lhs}
}
[improve help message for summary in send/pull/push.
David Roundy <[EMAIL PROTECTED]>**20050904123040
 For these commands, --summary only has an effect if --dry-run is also
 given.
] 
<
> {
hunk ./DarcsArguments.lhs 47
                         pipe_interactive, all_interactive,
                         gui_pipe_interactive, gui_interactive,
                         all_gui_pipe_interactive, all_gui_interactive,
- -                        summary, unified, tokens,
+                        summary, dryrun_summary, unified, tokens,
                         checkpoint, partial, partial_check,
                         diffflags, unidiff, xmloutput,
                         force_replace, dry_run,
hunk ./DarcsArguments.lhs 174
   changes_format, match_one_context, happy_forwarding, send_to_context,
   use_external_merge, target, cc, apply_conflict_options, reply, xmloutput,
   distname_option, patchname_option, edit_description, output, unidiff,
- -  unified, summary, compress, uncompress, uncompress_nocompress,
+  unified, summary, dryrun_summary,
+  compress, uncompress, uncompress_nocompress,
   nocompress, match_several_or_range, match_several_or_last,
   author, askdeps, lookforadds, ignoretimes, test, notest, help, force_replace,
   match_one, match_range, match_several, dry_run, fancy_move_add, sendmail_cmd,
hunk ./DarcsArguments.lhs 573
 #ifdef HAVEWX
 gui = DarcsNoArgOption ['g'] ["gui"] Gui "use graphical interface"
 #endif
+dryrun_summary = DarcsMultipleChoiceOption
+                 [DarcsNoArgOption ['s'] ["summary"] Summary
+                  "summarize changes if --dry-run is specified",
+                  DarcsNoArgOption [] ["no-summary"] NoSummary
+                  "don't summarize changes"]
 summary = DarcsMultipleChoiceOption
           [DarcsNoArgOption ['s'] ["summary"] Summary "summarize changes",
            DarcsNoArgOption [] ["no-summary"] NoSummary "don't summarize changes"]
hunk ./DarcsArguments.lhs 1033
 get_posthook_cmd (_:flags) = get_posthook_cmd flags
 get_posthook_cmd [] = Nothing
 \end{code}
+
hunk ./Pull.lhs 34
                         all_gui_interactive,
                         print_dry_run_message_and_exit,
                         any_verbosity, test, dry_run,
- -                        set_default, summary, working_repo_dir,
+                        set_default, dryrun_summary, working_repo_dir,
                         set_scripts_executable,
                       )
 import Repository ( Repository, PatchToken, identifyRepository,
hunk ./Pull.lhs 98
                      command_darcsoptions = [match_several,
                                              all_gui_interactive,
                                              use_external_merge,nocompress,
- -                                             test, dry_run, summary,
+                                             test, dry_run, dryrun_summary,
                                              any_verbosity,
                                              ignoretimes,no_deps,
                                              set_default,
hunk ./Push.lhs 24
 import Char ( toUpper )
 import DarcsCommands ( DarcsCommand(..) )
 import DarcsArguments ( DarcsFlag( DryRun, Verbose, Quiet ),
- -                        working_repo_dir, summary,
+                        working_repo_dir, dryrun_summary,
                         print_dry_run_message_and_exit,
                         applyas, match_several, fix_filepath,
                         all_gui_interactive, dry_run,
hunk ./Push.lhs 73
                      command_darcsoptions = [any_verbosity,
                                              match_several,
                                              all_gui_interactive,
- -                                             applyas, dry_run, summary,
+                                             applyas, dry_run,
+                                             dryrun_summary,
                                              working_repo_dir,
                                              set_default]}
 \end{code}
hunk ./Send.lhs 34
                         output, cc, target, author, sendmail_cmd,
                         all_gui_interactive, get_sendmail_cmd,
                         print_dry_run_message_and_exit,
- -                        any_verbosity, unified, summary,
+                        any_verbosity, unified, dryrun_summary,
                         from_opt, dry_run, send_to_context,
                       )
 import Repository ( PatchSet, Repository,
hunk ./Send.lhs 90
                                              all_gui_interactive,
                                              from_opt, author,
                                              target,cc,output,sign,
- -                                             unified, dry_run, summary,
+                                             unified, dry_run, dryrun_summary,
                                              send_to_context,
                                              edit_description,
                                              set_default, working_repo_dir,
}

Context:

[fix bug triggered by --no-pristine-tree and running test.
David Roundy <[EMAIL PROTECTED]>**20050903132055
 The trouble was that the NoPristine version of createPristineDirectoryTree
 would fail if the directory already exists, which isn't the intended
 behavior.  I also took this opportunity to remove the "stubbornly" function
 and replace some stubborn directory creation with
 createDirectoryIfMissing.
] 
[don't create test directory if we don't want to actually run test.
David Roundy <[EMAIL PROTECTED]>**20050903130722] 
[add test script that displays --no-pristine test-related bug.
David Roundy <[EMAIL PROTECTED]>**20050903132906] 
[clean up docs on flags directly to darcs (not to a darcs command).
David Roundy <[EMAIL PROTECTED]>**20050903124050] 
[bump version to 1.0.4rc1.
David Roundy <[EMAIL PROTECTED]>**20050903114002] 
[update the web page to direct new users first to the precompiled binaries rather than first to the source
[EMAIL PROTECTED] 
[fix "No root path(s) specified at ..." testsuite problem.
David Roundy <[EMAIL PROTECTED]>**20050830121603] 
[add test that triggers "too many open files" bug.
David Roundy <[EMAIL PROTECTED]>**20050827192215
 We just need to pull over 1024 patches at once to trigger this bug on my
 linux system.
] 
[TAG 1.0.4pre4
David Roundy <[EMAIL PROTECTED]>**20050901110418] 
Patch bundle hash:
e72fac9b8f38e95c6529b3f0f8d3cbc65f19bda9
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDGu9hQ6uZI9PVvOwRAt8mAKDGciHBr/G6/Y0SRLg3JwSuVSS3VQCfagax
6xnX27MQUiIEUpFdyI/6uJ0=
=oEBp
-----END PGP SIGNATURE-----
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel

Reply via email to