# # patch "ChangeLog" # from [20da57258f07e3fecb32253bcadcbfb237f81f6b] # to [808c36de6c842bd7ece657663adb2d9146a25b45] # # patch "monotone.texi" # from [9e37ce22ceb10715bf1ed4efa1fe44f1b1d02a22] # to [b616e44f5dba647ab024362f2524bee134e2c8e4] # # patch "std_hooks.lua" # from [80a530bdeb7e4526a8b97c9f9d6c071a7b1f05e0] # to [a155f905ed9e742f02ad6648546080b4e33719a4] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,10 @@ +2005-07-17 Nathaniel Smith
+ + * std_hooks.lua (external_diff_default_args): New variable. + (external_diff): Use it as a default, and use user-provided + diff_args otherwise. + * monotone.texi (Hooks): Document this. + 2005-07-16 Vladimir Vukicevic * lua.{cc,hh} (hook_external_diff): New hook. --- monotone.texi +++ monotone.texi @@ -5849,6 +5849,12 @@ will be passed in as @var{diff_args}. Otherwise @var{diff_args} will be nil. +The default implementation of this hook calls the program @code{diff}, +and if @option{--diff-args} were not passed, takes default arguments +from the lua variable @code{external_diff_default_args}. You can +override this variable in your configuration file, without overriding +the whole hook. + @end ftable @page --- std_hooks.lua +++ std_hooks.lua @@ -611,12 +611,15 @@ return false end +external_diff_default_args = "-u" + -- default external diff, works for gnu diff function external_diff(file_path, data_old, data_new, is_binary, diff_args, rev_old, rev_new) local old_file = write_to_temporary_file(data_old); local new_file = write_to_temporary_file(data_new); - execute("diff", "-upNU8", "--label", file_path .. "\told", old_file, "--label", file_path .. "\tnew", new_file); + if diff_args == nil then diff_args = external_diff_default_args end + execute("diff", diff_args, "--label", file_path .. "\told", old_file, "--label", file_path .. "\tnew", new_file); os.remove (old_file); os.remove (new_file);