# # # patch "INSTALL" # from [df6a35fc0a52cf22d8a971f021a173218c0554ee] # to [aaca8716964291d0a99d8d299a67438c402fa515] # # patch "NEWS" # from [61bb84d86cd4a4e3d0789b2c36c8d558ca9da2a4] # to [92a01f1c4f83fc8483a9487e709273aeebfa4f7a] # # patch "UPGRADE" # from [58cc349e2a00199c7fa8146d8f547727714e0ef3] # to [845201d129ada34e5ac38365fa0e17d6a02fd2c0] # # patch "docs/Adding-Files.html" # from [c21bf49f256b1c98ed0bef98c0e674af8b25a97b] # to [bf0e764efc777d89bbf91c6f21bde088059a3cbb] # # patch "docs/Additional-Lua-Functions.html" # from [274050e5aa317f4d355475201969763d8d583b54] # to [5957b5938941933b069683cd7d23e475c0e53cc2] # # patch "docs/CVS-Phrasebook.html" # from [49b1f46ca1aa939796d4264d29368574ccff1db8] # to [f2ae8c20d0d1cdb3a27a3b65abc1a8775e834d67] # # patch "docs/Default-hooks.html" # from [25a6de5bca250b1fa7577a791be50ee9fdf03620] # to [a2af884c83aef0ccf49ca2d0777c294b1c3b3ebd] # # patch "docs/Exporting-to-GIT.html" # from [8991ac6b9840b591b98996fe22960ad0908b4005] # to [a0765f5a8fc4adb72917d6ca3796fb17da353d59] # # patch "docs/GIT.html" # from [b0cdfe3720df246b6b61c5a09f2b8f48a19f01a6] # to [fab396bca3a9a3b0bc66073d7fc03b0c07560d39] # # patch "docs/General-Index.html" # from [3caf6780650738a50a3caab95360d82694dc68b7] # to [36b385540315469b12a4c33f225a5f2d4e13bb2c] # # patch "docs/Hooks.html" # from [c333b3e2916422180c25c72471a1c90d445dfd32] # to [270f2d2e929cf09827787b4011c1d23936967361] # # patch "docs/index.html" # from [7fe436b0b479b2a2974ac8d914ebd298d1889486] # to [02d16f787b348c8e0dd761cba94906942eab67e2] # # patch "monotone.html" # from [d4853e54ac1b4f1917445cc2236990f7be061f5d] # to [7b21456965e29d7099159aa7563bd20bd79011ee] # # patch "monotone.pdf" # from [c8a3b9aff84e174814c7cdcc9f3ec14f29c300eb] # to [e0de84ffb1e900af2a3bf440239538b725e7f016] # ============================================================ --- INSTALL df6a35fc0a52cf22d8a971f021a173218c0554ee +++ INSTALL aaca8716964291d0a99d8d299a67438c402fa515 @@ -233,7 +233,7 @@ 1. prerequisites: boost-devel-1.33.1 libsqlite3-devel-3.6.2 libidn-devel-1.9 - gettext-0.17 + gettext-devel-0.17 zlib-1.2.3 perl-5.10.0 botan-1.8.2 ============================================================ --- NEWS 61bb84d86cd4a4e3d0789b2c36c8d558ca9da2a4 +++ NEWS 92a01f1c4f83fc8483a9487e709273aeebfa4f7a @@ -1,3 +1,74 @@ +Sun Mar 14 21:15:06 UTC 2010 + + 0.47 release. + + Changes + + - The default '' author used by the git_export command has + changed to 'Unknown ' and must be changed in existing author + map files. The old '' author will be rejected by the new + validate_git_author lua hook. + + - The 'git_export' command now validates all git author and committer + values using a new 'validate_git_author' lua hook before they are + written to the output stream. The export will fail if any value is + rejected by this hook. + + - The 'git_export' command now calls a new 'unmapped_git_author' lua + hook for all git author values not found in the author map file. The + default implementation of this hook attempts to produce valid git + authors using several default pattern replacements. + + - The 'get_date_format_spec' lua hook now has an additional parameter + which hints at the wanted format (f.e. a short date or a long date + time). The default implementation now returns '%x' for short and + long dates, '%X' for short and long times (currently unused) and + '%x %X' for short and long date times. + + - The options '--date-format' and '--no-format-dates' are no longer + specific to the 'log' command, but can now be used globally. + + - monotone now prompts only three times for a key password. + + New features + + - Added portuguese translation (thanks to Américo Monteiro) + + Bugs fixed + + - 'passphrase' now allows an empty new password to be given + (fixes monotone bug #28809) + + - 'automate remote' and 'automate remote_stdio' no longer + require an existing database (fixes monotone bug #28885) + + - monotone no longer throws an exception on Windows if it is + interrupted (^C); a couple of other bug have been fixed for this + platform as well which generally improve the compatibility. + + - The annotation of 'annotate' is now localized. + + - The various occurrences where a revision is described by its + certs now come with proper localized date output. + + - Fix problems with newer Lua versions especially when + LUA_COMPAT_VARARG not set. + + Other + + - Roster handling has been sped up significantly, and roster cache + performance has been fixed for the case of overly large rosters. + This should be mostly noticable when digging through history + (especially initial pulls, since those send so many revisions), + and be more noticable for projects with larger trees. + + The most significant internal change from this is that rosters and + marking_maps are now copy-on-write. A longer overview of the internal + changes is at: + http://lists.gnu.org/archive/html/monotone-devel/2010-02/msg00043.html + + - Improve the compatibility with newer Botan versions. + Sun Jan 17 21:40:35 UTC 2010 0.46 release. ============================================================ --- UPGRADE 58cc349e2a00199c7fa8146d8f547727714e0ef3 +++ UPGRADE 845201d129ada34e5ac38365fa0e17d6a02fd2c0 @@ -1,4 +1,4 @@ -upgrading monotone to 0.46 +upgrading monotone to 0.47 ========================== How to read this file: ============================================================ --- docs/Adding-Files.html c21bf49f256b1c98ed0bef98c0e674af8b25a97b +++ docs/Adding-Files.html bf0e764efc777d89bbf91c6f21bde088059a3cbb @@ -80,7 +80,7 @@ recursively scans the directory and adds workspace. He specifies one filename and one directory; monotone recursively scans the directory and adds all its files. -
$ mtn add include/jb.h src
+
$ mtn add -R include/jb.h src
 mtn: adding include/jb.h to workspace manifest
 mtn: adding src/apple.c to workspace manifest
 mtn: adding src/banana.c to workspace manifest
============================================================
--- docs/Additional-Lua-Functions.html	274050e5aa317f4d355475201969763d8d583b54
+++ docs/Additional-Lua-Functions.html	5957b5938941933b069683cd7d23e475c0e53cc2
@@ -36,11 +36,11 @@ hook writers.
 hook writers.
 
      
-
alias_command(original, alias)
+
alias_command(original, alias)
This function adds a new alias for a monotone command. A call to this function would normally be placed directly in the monotonerc file, rather than in a hook function. -
existonpath(possible_command)
+
existonpath(possible_command)
This function receives a string containing the name of an external program and returns 0 if it exists on path and is executable, -1 otherwise. @@ -50,56 +50,56 @@ for “xxdiff.exe”. program name. In the previous example, existonpath would search for “xxdiff.exe”. -
get_confdir()
+
get_confdir()
Returns the path to the configuration directory, either implied or given with --confdir. -
get_ostype()
+
get_ostype()
Returns the operating system flavor as a string. -
guess_binary_file_contents(filespec)
+
guess_binary_file_contents(filespec)
Returns true if the file appears to be binary, i.e. contains one or more of the following characters:
     0x00 thru 0x06
      0x0E thru 0x1a
      0x1c thru 0x1f
 
-
include(scriptfile)
+
include(scriptfile)
This function tries to load and execute the script contained into scriptfile. It returns true for success and false if there is an error. -
includedir(scriptpath)
+
includedir(scriptpath)
This function loads and executes in alphabetical order all the scripts contained into the directory scriptpath. If one of the scripts has an error, the functions doesn't process the remaining scripts and immediately returns false. -
includedirpattern(scriptpath, pattern)
+
includedirpattern(scriptpath, pattern)
This function loads and executes in alphabetical order all the scripts contained into the directory scriptpath that match the given pattern. If one of the scripts has an error, the functions doesn't process the remaining scripts and immediately returns false. -
is_executable(filespec)
+
is_executable(filespec)
This function returns true if the file is executable, false otherwise. On Windows this function returns always false. -
kill(pid [, signal])
+
kill(pid [, signal])
This function calls the kill() C library function on POSIX systems and TerminateProcess on Win32 (in that case pid is the process handle). If the optional signal parameter is missing, SIGTERM will be used. Returns 0 on success, -1 on error. -
make_executable(filespec)
+
make_executable(filespec)
This function marks the named file as executable. On Windows has no effect. -
match(glob, string)
+
match(glob, string)
Returns true if glob matches str, return false otherwise. -
mkstemp(template)
+
mkstemp(template)
Like its C library counterpart, mkstemp creates a unique name and returns a file descriptor for the newly created file. The value of template should be a pointer to a character buffer loaded @@ -121,7 +121,7 @@ For the definition of temp_file()< file in the standard TMP/TEMP directories. For the definition of temp_file(), see Default hooks. -
mtn_automate( ... )
+
mtn_automate( ... )
The mtn_automate Lua function calls the Monotone automate command passed in its arguments. The result of the call is a pair consisting of a boolean return code, indicating whether @@ -134,7 +134,7 @@ keys will therefor fail unless the get_passphrase hook is set up locally. -
parse_basic_io(data)
+
parse_basic_io(data)
Parse the string data, which should be in basic_io format. It returns nil if it can't parse the string; otherwise it returns a table. This will be a list of all statements, with each entry being a table having a "name" element that is @@ -156,17 +156,17 @@ the arguments. 4 = { name = "frob", values = { 1 = "oops" } } }
-
regex.search(regexp, string)
+
regex.search(regexp, string)
Returns true if a match for regexp is found in str, return false otherwise. See Regexps, for the syntax of regexp. -
register_command(name, params, abstract, description, function)
+
register_command(name, params, abstract, description, function)
Add a command named name to the user command group in monotone. This function is normally called directly from a monotonerc file rather than a hook. When the user issues the registered command, monotone will call the lua function name supplied. That function would then normally use mtn_automate() calls to service the request. -
server_request_sync(what, address, include, exclude)
+
server_request_sync(what, address, include, exclude)
Initiate a netsync connection to the server at address, with the given include and exclude patterns, of type sync, push, or pull, as given by the what argument. @@ -174,10 +174,16 @@ command, this function has no effect.

When called by a monotone instance which is not running the serve command, this function has no effect. -

sleep(seconds)
+
server_set_listening(boolean)
+If the argument is false, make the server not listen for incoming +connections, and exit when all existing connections have closed. + +

If the argument is true, cancel an earlier call with false given. + +

sleep(seconds)
Makes the calling process sleep for the specified number of seconds. -
spawn(executable [, args ...])
+
spawn(executable [, args ...])
Starts the named executable with the given arguments. Returns the process PID on POSIX systems, the process handle on Win32 or -1 if there was an error. @@ -189,17 +195,17 @@ in a standardized way. option. execute() builds on spawn() and wait() in a standardized way. -
spawn_pipe(executable [, args ...])
+
spawn_pipe(executable [, args ...])
Like spawn(), but returns three values, where the first two are the subprocess' standard input and standard output, and the last is the process PID on POSIX systems, the process handle on Win32 or -1 if there was an error. -
spawn_redirected(infile, outfile, errfile, executable [, args ...])
+
spawn_redirected(infile, outfile, errfile, executable [, args ...])
Like spawn(), but with standard input, standard output and standard error redirected to the given files. -
wait(pid)
+
wait(pid)
Wait until the process with given PID (process handle on Win32) exits. Returns two values: a result value and the exit code of the waited-for process. ============================================================ --- docs/CVS-Phrasebook.html 49b1f46ca1aa939796d4264d29368574ccff1db8 +++ docs/CVS-Phrasebook.html f2ae8c20d0d1cdb3a27a3b65abc1a8775e834d67 @@ -251,7 +251,7 @@ monotone where to start displaying the l

$ mtn --db=/path/to/database.mtn --branch=com.foo.wobbler setup .
-$ mtn add .
+$ mtn add -R .
 $ mtn commit
 


============================================================ --- docs/Default-hooks.html 25a6de5bca250b1fa7577a791be50ee9fdf03620 +++ docs/Default-hooks.html a2af884c83aef0ccf49ca2d0777c294b1c3b3ebd @@ -70,7 +70,7 @@ function execute(path, ...) function execute(path, ...) local pid local ret = -1 - pid = spawn(path, unpack(arg)) + pid = spawn(path, ...) if (pid ~= -1) then ret, pid = wait(pid) end return ret end @@ -79,7 +79,7 @@ function execute_redirected(stdin, stdou local pid local ret = -1 io.flush(); - pid = spawn_redirected(stdin, stdout, stderr, path, unpack(arg)) + pid = spawn_redirected(stdin, stdout, stderr, path, ...) if (pid ~= -1) then ret, pid = wait(pid) end return ret end @@ -89,7 +89,7 @@ function execute_confirm(path, ...) -- This is needed to work around some brokenness with some merge tools -- (e.g. on OS X) function execute_confirm(path, ...) - ret = execute(path, unpack(arg)) + ret = execute(path, ...) if (ret ~= 0) then @@ -330,10 +330,10 @@ function edit_comment(basetext, user_log elseif (program_exists_in_path("editor")) then exe = "editor" elseif (program_exists_in_path("vi")) then exe = "vi" elseif (string.sub(get_ostype(), 1, 6) ~= "CYGWIN" and - program_exists_in_path("notepad.exe")) then exe = "notepad" + program_exists_in_path("notepad.exe")) then exe = "notepad" else io.write(gettext("Could not find editor to enter commit message\n" - .. "Try setting the environment variable EDITOR\n")) + .. "Try setting the environment variable EDITOR\n")) return nil end @@ -356,22 +356,22 @@ function edit_comment(basetext, user_log if (not string.find(exe, "[^%w_.+-]")) then -- safe to call spawn directly if (execute(exe, tname) ~= 0) then - io.write(string.format(gettext("Error running editor '%s' ".. - "to enter log message\n"), + io.write(string.format(gettext("Error running editor '%s' ".. + "to enter log message\n"), exe)) - os.remove(tname) - return nil + os.remove(tname) + return nil end else -- must use shell local shell = os.getenv("SHELL") if (shell == nil) then shell = "sh" end if (not program_exists_in_path(shell)) then - io.write(string.format(gettext("Editor command '%s' needs a shell, ".. - "but '%s' is not to be found"), - exe, shell)) - os.remove(tname) - return nil + io.write(string.format(gettext("Editor command '%s' needs a shell, ".. + "but '%s' is not to be found"), + exe, shell)) + os.remove(tname) + return nil end -- Single-quoted strings in both Bourne shell and csh can contain @@ -379,11 +379,11 @@ function edit_comment(basetext, user_log local safe_tname = " '" .. string.gsub(tname, "'", "'\\''") .. "'" if (execute(shell, "-c", editor .. safe_tname) ~= 0) then - io.write(string.format(gettext("Error running editor '%s' ".. - "to enter log message\n"), + io.write(string.format(gettext("Error running editor '%s' ".. + "to enter log message\n"), exe)) - os.remove(tname) - return nil + os.remove(tname) + return nil end end @@ -417,14 +417,14 @@ end return false end -function get_date_format_spec() +function get_date_format_spec(wanted) -- Return the strftime(3) specification to be used to print dates -- in human-readable format after conversion to the local timezone. -- The default uses the preferred date and time representation for -- the current locale, e.g. the output looks like this: "09/08/2009 - -- 06:49:26 PM" for en_US, or "08.09.2009 18:49:26" for de_DE. - return "%x %X" - + -- 06:49:26 PM" for en_US and "date_time_long", or "08.09.2009" + -- for de_DE and "date_short" + -- -- A sampling of other possible formats you might want: -- default for your locale: "%c" (may include a confusing timezone label) -- 12 hour format: "%d %b %Y, %I:%M:%S %p" @@ -433,6 +433,14 @@ function get_date_format_spec() -- ISO 8601: "%Y-%m-%d %H:%M:%S" or "%Y-%m-%dT%H:%M:%S" -- -- ISO 8601, no timezone conversion: "" + --. + if (wanted == "date_long" or wanted == "date_short") then + return "%x" + end + if (wanted == "time_long" or wanted == "time_short") then + return "%X" + end + return "%x %X" end -- trust evaluation hooks @@ -504,9 +512,9 @@ mergers.meld = { mergers.meld = { cmd = function (tbl) io.write (string.format("\nWARNING: 'meld' was chosen to perform ".. - "an external 3-way merge.\n".. - "You must merge all changes to the ".. - "*CENTER* file.")) + "an external 3-way merge.\n".. + "You must merge all changes to the ".. + "*CENTER* file.")) local path = "meld" local ret = execute(path, tbl.lfile, tbl.afile, tbl.rfile) if (ret ~= 0) then @@ -553,9 +561,9 @@ mergers.vim = { end io.write (string.format("\nWARNING: 'vim' was chosen to perform ".. - "an external 3-way merge.\n".. - "You must merge all changes to the ".. - "*LEFT* file.\n")) + "an external 3-way merge.\n".. + "You must merge all changes to the ".. + "*LEFT* file.\n")) local vim if os.getenv ("DISPLAY") ~= nil and program_exists_in_path ("gvim") then @@ -1439,6 +1447,41 @@ end return push_hook_functions(notifier) end end + +-- to ensure only mapped authors are allowed through +-- return "" from unmapped_git_author +-- and validate_git_author will fail + +function unmapped_git_author(author) + -- replace "address@hidden" with "foo <address@hidden>" + name = author:match("^([^<>]+)@[^<>]+$") + if name then + return name .. " <" .. author .. ">" + end + + -- replace "<address@hidden>" with "foo <address@hidden>" + name = author:match("^<([^<>]+)@[^<>]+>$") + if name then + return name .. " " .. author + end + + -- replace "foo" with "foo <foo>" + name = author:match("^[^<>@]+$") + if name then + return name .. " <" .. name .. ">" + end + + return author -- unchanged +end + +function validate_git_author(author) + -- ensure author matches the "Name <email>" format git expects + if author:match("^[^<]+ <[^>]*>$") then + return true + end + + return false +end ============================================================ --- docs/Exporting-to-GIT.html 8991ac6b9840b591b98996fe22960ad0908b4005 +++ docs/Exporting-to-GIT.html a0765f5a8fc4adb72917d6ca3796fb17da353d59 @@ -64,23 +64,27 @@ git commit message using the Monotone author names often look like raw email addresses such as "address@hidden". These are not considered valid by git -which requires leading `<' and trailing `>' characters around email -addresses and by convention often includes the display name with the -email address such as "User Name <address@hidden>". The git -exporter deals with this difference in several ways: +which requires the display name and leading `<' and trailing `>' +characters around email addresses such as "User Name +<address@hidden>". The git exporter deals with this difference in +several ways:

  • revisions that don't have any author certs will default to using -<unknown> for both the author and committer. +Unknown <unknown> for both the author and committer.
  • revisions that have one or more author certs will use the value of one author cert as the author and the key used to sign this cert as the committer.
  • both author and committer will be looked up in the file specified by the --authors-file option described in GIT and translated to the specified value if found. -
  • any author or committer that does not contain both `<' and `>' -characters will have an initial “<' character and a final `>' -character added so that they may form valid values. +
  • any author or committer value not found in the authors file will be +processed by the unmapped_git_author hook which may adjust the +value so that it represents a valid value.
+All git author and committer values will be validated by the +validate_git_author hook before being written to the output +stream. The export will abort if any author or committer value is +rejected by the validation hook.

Branch names used by monotone are allowed to contain characters that are not considered valid by git. These may be mapped to other names ============================================================ --- docs/GIT.html b0cdfe3720df246b6b61c5a09f2b8f48a19f01a6 +++ docs/GIT.html fab396bca3a9a3b0bc66073d7fc03b0c07560d39 @@ -57,7 +57,10 @@ from a monotone database with the follow from a monotone database with the following sql query:

     
-     $ mtn db execute 'select distinct keypair from revision_certs' where name = "author"'
+     $ mtn db execute 'select distinct public_keys.name
+                       from public_keys
+                       left join revision_certs on revision_certs.keypair_id = public_keys.id
+                       where revision_certs.name = "author"'
 

The --branches-file option may be used to map monotone branch @@ -69,9 +72,9 @@ specified in the branches-file -

Revisions with no author cert will use <unknown> for both the author -and the committer. These can be mapped to other values using the -authors-file option. +

Revisions with no author cert will use "Unknown <unknown>" for both +the author and the committer. These can be mapped to other values +using the authors-file option.

The list of branches that might need to be mapped can be extracted from a monotone database with using the ls branches command: ============================================================ --- docs/General-Index.html 3caf6780650738a50a3caab95360d82694dc68b7 +++ docs/General-Index.html 36b385540315469b12a4c33f225a5f2d4e13bb2c @@ -33,19 +33,19 @@ Up: 

  • accept_testresult_change (old_results, new_results): Hooks
  • -
  • alias_command(original, alias): Additional Lua Functions
  • +
  • alias_command(original, alias): Additional Lua Functions
  • attr_functions [attribute] (filename, value): Hooks
  • attr_init_functions [attribute] (filename): Hooks
  • -
  • drop: Conflicts
  • +
  • drop: Conflicts
  • edit_comment (commentary, user_log_message): Hooks
  • -
  • existonpath(possible_command): Additional Lua Functions
  • +
  • existonpath(possible_command): Additional Lua Functions
  • expand_date (str): Hooks
  • expand_selector (str): Hooks
  • external_diff (file_path, old_data, new_data, is_binary, diff_args, old_rev, new_rev): Hooks
  • get_author (branchname, key_identity): Hooks
  • get_branch_key (branchname): Hooks
  • -
  • get_confdir(): Additional Lua Functions
  • -
  • get_date_format_spec (): Hooks
  • +
  • get_confdir(): Additional Lua Functions
  • +
  • get_date_format_spec (wanted): Hooks
  • get_default_command_options(command): Hooks
  • get_encloser_pattern (file_path): Hooks
  • get_local_key_name (key_identity): Hooks
  • @@ -54,27 +54,27 @@ Up: get_netsync_key(server, include, exclude): Hooks
  • get_netsync_read_permitted (branch, key_identity): Hooks
  • get_netsync_write_permitted (key_identity): Hooks
  • -
  • get_ostype(): Additional Lua Functions
  • +
  • get_ostype(): Additional Lua Functions
  • get_passphrase (key_identity): Hooks
  • get_preferred_merge3_command(tbl): Hooks
  • get_remote_automate_permitted(key_identity, command, options): Hooks
  • get_revision_cert_trust (signers, id, name, val): Hooks
  • -
  • guess_binary_file_contents(filespec): Additional Lua Functions
  • -
  • hook_wrapper (func_name, ...): Hooks
  • +
  • guess_binary_file_contents(filespec): Additional Lua Functions
  • +
  • hook_wrapper (func_name, ...): Hooks
  • ignore_branch (branchname): Hooks
  • ignore_file (filename): Hooks
  • -
  • include(scriptfile): Additional Lua Functions
  • -
  • includedir(scriptpath): Additional Lua Functions
  • -
  • includedirpattern(scriptpath, pattern): Additional Lua Functions
  • +
  • include(scriptfile): Additional Lua Functions
  • +
  • includedir(scriptpath): Additional Lua Functions
  • +
  • includedirpattern(scriptpath, pattern): Additional Lua Functions
  • interactive file: Conflicts
  • -
  • is_executable(filespec): Additional Lua Functions
  • +
  • is_executable(filespec): Additional Lua Functions
  • keep: Conflicts
  • key_identity: Hooks
  • -
  • kill(pid [, signal]): Additional Lua Functions
  • -
  • make_executable(filespec): Additional Lua Functions
  • -
  • match(glob, string): Additional Lua Functions
  • +
  • kill(pid [, signal]): Additional Lua Functions
  • +
  • make_executable(filespec): Additional Lua Functions
  • +
  • match(glob, string): Additional Lua Functions
  • merge3 (ancestor_path, left_path, right_path, merged_path, ancestor_text, left_text, right_text): Hooks
  • -
  • mkstemp(template): Additional Lua Functions
  • +
  • mkstemp(template): Additional Lua Functions
  • mtn [--bookkeep-only] drop pathname...: Workspace
  • mtn [--bookkeep-only] mv src dst: Workspace
  • mtn [--bookkeep-only] mv src1 ... dst/: Workspace
  • @@ -129,8 +129,8 @@ Up: mtn automate packet_for_fdata id: Automation
  • mtn automate packet_for_fdelta from-id to-id: Automation
  • mtn automate packet_for_fdelta id1 id2: Packet I/O
  • +
  • mtn automate packet_for_rdata id: Packet I/O
  • mtn automate packet_for_rdata id: Automation
  • -
  • mtn automate packet_for_rdata id: Packet I/O
  • mtn automate packets_for_certs id: Packet I/O
  • mtn automate parents rev: Automation
  • mtn automate pull [--set-default] [uri-or-address] [glob [...] [--exclude=exclude-glob]]]: Automation
  • @@ -291,7 +291,7 @@ Up: mtn unset domain name: Database
  • mtn update [--move-conflicting-paths]: Workspace
  • mtn update [--move-conflicting-paths] --revision=revision: Workspace
  • -
  • mtn_automate( ... ): Additional Lua Functions
  • +
  • mtn_automate( ... ): Additional Lua Functions
  • note_commit (new_id, revision, certs): Hooks
  • note_mtn_startup (...): Hooks
  • note_netsync_cert_received (rev_id, key_identity, name, value, session_id): Hooks
  • @@ -302,20 +302,23 @@ Up: note_netsync_revision_received (new_id, revision, certs, session_id): Hooks
  • note_netsync_revision_sent (rev_id, revision, certs, session_id): Hooks
  • note_netsync_start (session_id, my_role, sync_type, remote_host, remote_key, includes, excludes): Hooks
  • -
  • parse_basic_io(data): Additional Lua Functions
  • +
  • parse_basic_io(data): Additional Lua Functions
  • persist_phrase_ok (): Hooks
  • -
  • regex.search(regexp, string): Additional Lua Functions
  • -
  • register_command(name, params, abstract, description, function): Additional Lua Functions
  • +
  • regex.search(regexp, string): Additional Lua Functions
  • +
  • register_command(name, params, abstract, description, function): Additional Lua Functions
  • rename filename: Conflicts
  • -
  • server_request_sync(what, address, include, exclude): Additional Lua Functions
  • -
  • sleep(seconds): Additional Lua Functions
  • -
  • spawn(executable [, args ...]): Additional Lua Functions
  • -
  • spawn_pipe(executable [, args ...]): Additional Lua Functions
  • -
  • spawn_redirected(infile, outfile, errfile, executable [, args ...]): Additional Lua Functions
  • +
  • server_request_sync(what, address, include, exclude): Additional Lua Functions
  • +
  • server_set_listening(boolean): Additional Lua Functions
  • +
  • sleep(seconds): Additional Lua Functions
  • +
  • spawn(executable [, args ...]): Additional Lua Functions
  • +
  • spawn_pipe(executable [, args ...]): Additional Lua Functions
  • +
  • spawn_redirected(infile, outfile, errfile, executable [, args ...]): Additional Lua Functions
  • +
  • unmapped_git_author(author): Hooks
  • use_inodeprints (): Hooks
  • use_transport_auth (uri): Hooks
  • -
  • user file: Conflicts
  • -
  • validate_commit_message (message, revision_text, branchname): Hooks
  • -
  • wait(pid): Additional Lua Functions
  • +
  • user file: Conflicts
  • +
  • validate_commit_message (message, revision_text, branchname): Hooks
  • +
  • validate_git_author(author): Hooks
  • +
  • wait(pid): Additional Lua Functions
  • ============================================================ --- docs/Hooks.html c333b3e2916422180c25c72471a1c90d445dfd32 +++ docs/Hooks.html 270f2d2e929cf09827787b4011c1d23936967361 @@ -370,11 +370,19 @@ definition, therefore the default behavi branches. Otherwise returns false. This hook has no default definition, therefore the default behavior is to list all branches. -
    get_date_format_spec ()
    +
    get_date_format_spec (wanted)
    Returns a strftime format specification, which mtn log and similar commands will use to format dates, unless instructed -otherwise. The default definition returns `"%d %b %Y, %I:%M:%S %p"', which produces output like this: `22 May 2009, 09:06:14 AM'. +otherwise. The default definition returns `%x' for long and short +date formats, `%X' for long and short time formats and `%x %X' +for long and short date time formats, which is equivalent to `22/05/09', +`09:06:14' and `22/05/09 09:06:14' in an English locale. +

    wanted can be one of `date_long', `date_short', +`time_long', `time_short', `date_time_long' and +`date_time_short', though only `date_short' and +`date_time_short' are currently used. +

    6.1.4 Netsync Permission Hooks

    @@ -874,13 +882,41 @@ definition is: -

    6.1.11 Validation Hooks

    +

    6.1.11 GIT Export Hooks

    +

    Exporting monotone revisions in git-fast-import(1) format often +requires translation of monotone author cert values and associated +signing keys into corresponding git author and committer +values. Translation of author and committer values and validation of +the results is controlled by these hooks. See Default hooks. + +

    +
    unmapped_git_author(author)
    +This hook is called for any git author or committer value that does +not come from the current author map file. If no author +map file is specified this hook will be called for every +unique git author and committer value. It may return the value +unchanged or modify it in some way in an effort to ensure that it is +valid. The default implementation attempts several common pattern +replacements to produce valid authors from monotone authors. + +
    validate_git_author(author)
    +This hook is called before the git author or committer value is +written to the export output stream. The author value is either +the mapped value from the current author map file or the value +produced by the unmapped_git_author hook. This hook may return +true if the author is valid or false if it is not. The export will be +aborted if this hook returns false for any value. + +
    + +

    6.1.12 Validation Hooks

    +

    If there is a policy decision to make, Monotone defines certain hooks to allow a client to validate or reject certain behaviors.

    -
    validate_commit_message (message, revision_text, branchname)
    +
    validate_commit_message (message, revision_text, branchname)
    This hook is called after the user has entered his/her commit message. message is the commit message that the user has entered and revision_text is the full text of the changes for this revision, @@ -894,13 +930,13 @@ rejects empty log messages.
    -

    6.1.12 Meta Hooks

    +

    6.1.13 Meta Hooks

    Monotone allows the execution of arbitrary Lua hooks and functions through a special generalized "meta hook". See automate lua for more information.

    -
    hook_wrapper (func_name, ...)
    +
    hook_wrapper (func_name, ...)
    This hook is explicitely called on every execution of automate lua. It takes a function name and zero or more string function arguments which are internally evaluated into Lua code. It returns a dump of the return value of ============================================================ --- docs/index.html 7fe436b0b479b2a2974ac8d914ebd298d1889486 +++ docs/index.html 02d16f787b348c8e0dd761cba94906942eab67e2 @@ -159,8 +159,9 @@ version control tools.
  • 6.1.8 External Merge Tools
  • 6.1.9 Selector Expansion
  • 6.1.10 Attribute Handling -
  • 6.1.11 Validation Hooks -
  • 6.1.12 Meta Hooks +
  • 6.1.11 GIT Export Hooks +
  • 6.1.12 Validation Hooks +
  • 6.1.13 Meta Hooks
  • 6.2 Additional Lua Functions
  • ============================================================ --- monotone.html d4853e54ac1b4f1917445cc2236990f7be061f5d +++ monotone.html 7b21456965e29d7099159aa7563bd20bd79011ee @@ -44,7 +44,7 @@ version control tools.

    Complete table of contents

    @@ -920,7 +921,7 @@ recursively scans the directory and adds workspace. He specifies one filename and one directory; monotone recursively scans the directory and adds all its files. -
    $ mtn add include/jb.h src
    +
    $ mtn add -R include/jb.h src
     mtn: adding include/jb.h to workspace manifest
     mtn: adding src/apple.c to workspace manifest
     mtn: adding src/banana.c to workspace manifest
    @@ -2296,7 +2297,7 @@ file, and given to the merge command via the
     --resolve-conflicts-file=filename or
    ---resolve-conflicts option; see See Conflicts.
    +--resolve-conflicts option; see Siehe Conflicts.
     
     

    The merge command normally will perform as many merges as necessary to merge all current heads of a branch. However, when @@ -2858,7 +2859,7 @@ any file with a name matching one of the

    .mtn-ignore
    Contains a list of regular expression patterns, one per line. If it exists, any file with a name matching one of these patterns is -ignored. See Regexps, for the syntax of these regular expressions. +ignored. Siehe Regexps, for the syntax of these regular expressions.
    _MTN/wanted-testresults
    Contains a list of testresult key names, one per line. If it exists, update will only select revisions that do not have regressions according to the given testresult keys. @@ -3176,23 +3177,27 @@ git commit message using the Monotone author names often look like raw email addresses such as "address@hidden". These are not considered valid by git -which requires leading `<' and trailing `>' characters around email -addresses and by convention often includes the display name with the -email address such as "User Name <address@hidden>". The git -exporter deals with this difference in several ways: +which requires the display name and leading `<' and trailing `>' +characters around email addresses such as "User Name +<address@hidden>". The git exporter deals with this difference in +several ways:
    • revisions that don't have any author certs will default to using -<unknown> for both the author and committer. +Unknown <unknown> for both the author and committer.
    • revisions that have one or more author certs will use the value of one author cert as the author and the key used to sign this cert as the committer.
    • both author and committer will be looked up in the file specified by the --authors-file option described in GIT and translated to the specified value if found. -
    • any author or committer that does not contain both `<' and `>' -characters will have an initial “<' character and a final `>' -character added so that they may form valid values. +
    • any author or committer value not found in the authors file will be +processed by the unmapped_git_author hook which may adjust the +value so that it represents a valid value.
    +All git author and committer values will be validated by the +validate_git_author hook before being written to the output +stream. The export will abort if any author or committer value is +rejected by the validation hook.

    Branch names used by monotone are allowed to contain characters that are not considered valid by git. These may be mapped to other names @@ -3655,7 +3660,7 @@ monotone where to start displaying the l

    $ mtn --db=/path/to/database.mtn --branch=com.foo.wobbler setup .
    -$ mtn add .
    +$ mtn add -R .
     $ mtn commit
     


    @@ -3882,7 +3887,7 @@ two heads that the merge command would merge are used.

    The conflicts file format is as output by the automate -show_conflicts command; see See Automation. +show_conflicts command; see Siehe Automation.

    Content conflicts that can be resolved by the internal line merger have resolutions, so they will not show up in subsequent @@ -4585,7 +4590,7 @@ adjust the expression used with the Lua regular expression is correct for many programming languages. You can adjust the expression used with the Lua hook get_encloser_pattern; Hooks. For the regular expression -syntax, See Regexps. +syntax, Siehe Regexps.

    --unified requests the “unified diff” format, the default. --context requests the “context diff” format (analogous to @@ -8095,7 +8100,7 @@ For single file conflicts, the res

    For single file conflicts, the resolved_*_left resolution name is used. -

    See Conflicts, for more information on conflict resolutions. +

    Siehe Conflicts, for more information on conflict resolutions.

    Output format:
    First the revision ids of the left and right revisions, and their @@ -8294,7 +8299,10 @@ from a monotone database with the follow from a monotone database with the following sql query:
         
    -     $ mtn db execute 'select distinct keypair from revision_certs' where name = "author"'
    +     $ mtn db execute 'select distinct public_keys.name
    +                       from public_keys
    +                       left join revision_certs on revision_certs.keypair_id = public_keys.id
    +                       where revision_certs.name = "author"'
     

    The --branches-file option may be used to map monotone branch @@ -8306,9 +8314,9 @@ specified in the branches-file -

    Revisions with no author cert will use <unknown> for both the author -and the committer. These can be mapped to other values using the -authors-file option. +

    Revisions with no author cert will use "Unknown <unknown>" for both +the author and the committer. These can be mapped to other values +using the authors-file option.

    The list of branches that might need to be mapped can be extracted from a monotone database with using the ls branches command: @@ -8769,11 +8777,19 @@ definition, therefore the default behavi branches. Otherwise returns false. This hook has no default definition, therefore the default behavior is to list all branches. -

    get_date_format_spec ()
    +
    get_date_format_spec (wanted)
    Returns a strftime format specification, which mtn log and similar commands will use to format dates, unless instructed -otherwise. The default definition returns `"%d %b %Y, %I:%M:%S %p"', which produces output like this: `22 May 2009, 09:06:14 AM'. +otherwise. The default definition returns `%x' for long and short +date formats, `%X' for long and short time formats and `%x %X' +for long and short date time formats, which is equivalent to `22/05/09', +`09:06:14' and `22/05/09 09:06:14' in an English locale. +

    wanted can be one of `date_long', `date_short', +`time_long', `time_short', `date_time_long' and +`date_time_short', though only `date_short' and +`date_time_short' are currently used. +

    6.1.4 Netsync Permission Hooks

    @@ -9094,7 +9110,7 @@ hook; and if you send it to the monotone regular expressions that match their particular syntax. If you have a better regular expression for some language, you can add it to this hook; and if you send it to the monotone developers, we will likely -make it the default for that language. See Regexps, for the +make it the default for that language. Siehe Regexps, for the regular expression syntax.
    external_diff (file_path, old_data, new_data, is_binary, diff_args, old_rev, new_rev)
    @@ -9273,13 +9289,41 @@ definition is: -

    6.1.11 Validation Hooks

    +

    6.1.11 GIT Export Hooks

    +

    Exporting monotone revisions in git-fast-import(1) format often +requires translation of monotone author cert values and associated +signing keys into corresponding git author and committer +values. Translation of author and committer values and validation of +the results is controlled by these hooks. See Default hooks. + +

    +
    unmapped_git_author(author)
    +This hook is called for any git author or committer value that does +not come from the current author map file. If no author +map file is specified this hook will be called for every +unique git author and committer value. It may return the value +unchanged or modify it in some way in an effort to ensure that it is +valid. The default implementation attempts several common pattern +replacements to produce valid authors from monotone authors. + +
    validate_git_author(author)
    +This hook is called before the git author or committer value is +written to the export output stream. The author value is either +the mapped value from the current author map file or the value +produced by the unmapped_git_author hook. This hook may return +true if the author is valid or false if it is not. The export will be +aborted if this hook returns false for any value. + +
    + +

    6.1.12 Validation Hooks

    +

    If there is a policy decision to make, Monotone defines certain hooks to allow a client to validate or reject certain behaviors.

    -
    validate_commit_message (message, revision_text, branchname)
    +
    validate_commit_message (message, revision_text, branchname)
    This hook is called after the user has entered his/her commit message. message is the commit message that the user has entered and revision_text is the full text of the changes for this revision, @@ -9293,13 +9337,13 @@ rejects empty log messages.
    -

    6.1.12 Meta Hooks

    +

    6.1.13 Meta Hooks

    Monotone allows the execution of arbitrary Lua hooks and functions through a special generalized "meta hook". See automate lua for more information.

    -
    hook_wrapper (func_name, ...)
    +
    hook_wrapper (func_name, ...)
    This hook is explicitely called on every execution of automate lua. It takes a function name and zero or more string function arguments which are internally evaluated into Lua code. It returns a dump of the return value of @@ -9315,11 +9359,11 @@ hook writers. hook writers.
    -
    alias_command(original, alias)
    +
    alias_command(original, alias)
    This function adds a new alias for a monotone command. A call to this function would normally be placed directly in the monotonerc file, rather than in a hook function. -
    existonpath(possible_command)
    +
    existonpath(possible_command)
    This function receives a string containing the name of an external program and returns 0 if it exists on path and is executable, -1 otherwise. @@ -9329,56 +9373,56 @@ for “xxdiff.exe”. program name. In the previous example, existonpath would search for “xxdiff.exe”. -
    get_confdir()
    +
    get_confdir()
    Returns the path to the configuration directory, either implied or given with --confdir. -
    get_ostype()
    +
    get_ostype()
    Returns the operating system flavor as a string. -
    guess_binary_file_contents(filespec)
    +
    guess_binary_file_contents(filespec)
    Returns true if the file appears to be binary, i.e. contains one or more of the following characters:
         0x00 thru 0x06
          0x0E thru 0x1a
          0x1c thru 0x1f
     
    -
    include(scriptfile)
    +
    include(scriptfile)
    This function tries to load and execute the script contained into scriptfile. It returns true for success and false if there is an error. -
    includedir(scriptpath)
    +
    includedir(scriptpath)
    This function loads and executes in alphabetical order all the scripts contained into the directory scriptpath. If one of the scripts has an error, the functions doesn't process the remaining scripts and immediately returns false. -
    includedirpattern(scriptpath, pattern)
    +
    includedirpattern(scriptpath, pattern)
    This function loads and executes in alphabetical order all the scripts contained into the directory scriptpath that match the given pattern. If one of the scripts has an error, the functions doesn't process the remaining scripts and immediately returns false. -
    is_executable(filespec)
    +
    is_executable(filespec)
    This function returns true if the file is executable, false otherwise. On Windows this function returns always false. -
    kill(pid [, signal])
    +
    kill(pid [, signal])
    This function calls the kill() C library function on POSIX systems and TerminateProcess on Win32 (in that case pid is the process handle). If the optional signal parameter is missing, SIGTERM will be used. Returns 0 on success, -1 on error. -
    make_executable(filespec)
    +
    make_executable(filespec)
    This function marks the named file as executable. On Windows has no effect. -
    match(glob, string)
    +
    match(glob, string)
    Returns true if glob matches str, return false otherwise. -
    mkstemp(template)
    +
    mkstemp(template)
    Like its C library counterpart, mkstemp creates a unique name and returns a file descriptor for the newly created file. The value of template should be a pointer to a character buffer loaded @@ -9400,7 +9444,7 @@ For the definition of temp_file()< file in the standard TMP/TEMP directories. For the definition of temp_file(), see Default hooks. -
    mtn_automate( ... )
    +
    mtn_automate( ... )
    The mtn_automate Lua function calls the Monotone automate command passed in its arguments. The result of the call is a pair consisting of a boolean return code, indicating whether @@ -9413,7 +9457,7 @@ keys will therefor fail unless the get_passphrase hook is set up locally. -
    parse_basic_io(data)
    +
    parse_basic_io(data)
    Parse the string data, which should be in basic_io format. It returns nil if it can't parse the string; otherwise it returns a table. This will be a list of all statements, with each entry being a table having a "name" element that is @@ -9435,17 +9479,17 @@ the arguments. 4 = { name = "frob", values = { 1 = "oops" } } } -
    regex.search(regexp, string)
    +
    regex.search(regexp, string)
    Returns true if a match for regexp is found in str, return -false otherwise. See Regexps, for the syntax of regexp. +false otherwise. Siehe Regexps, for the syntax of regexp. -
    register_command(name, params, abstract, description, function)
    +
    register_command(name, params, abstract, description, function)
    Add a command named name to the user command group in monotone. This function is normally called directly from a monotonerc file rather than a hook. When the user issues the registered command, monotone will call the lua function name supplied. That function would then normally use mtn_automate() calls to service the request. -
    server_request_sync(what, address, include, exclude)
    +
    server_request_sync(what, address, include, exclude)
    Initiate a netsync connection to the server at address, with the given include and exclude patterns, of type sync, push, or pull, as given by the what argument. @@ -9453,10 +9497,16 @@ command, this function has no effect.

    When called by a monotone instance which is not running the serve command, this function has no effect. -

    sleep(seconds)
    +
    server_set_listening(boolean)
    +If the argument is false, make the server not listen for incoming +connections, and exit when all existing connections have closed. + +

    If the argument is true, cancel an earlier call with false given. + +

    sleep(seconds)
    Makes the calling process sleep for the specified number of seconds. -
    spawn(executable [, args ...])
    +
    spawn(executable [, args ...])
    Starts the named executable with the given arguments. Returns the process PID on POSIX systems, the process handle on Win32 or -1 if there was an error. @@ -9468,17 +9518,17 @@ in a standardized way. option. execute() builds on spawn() and wait() in a standardized way. -
    spawn_pipe(executable [, args ...])
    +
    spawn_pipe(executable [, args ...])
    Like spawn(), but returns three values, where the first two are the subprocess' standard input and standard output, and the last is the process PID on POSIX systems, the process handle on Win32 or -1 if there was an error. -
    spawn_redirected(infile, outfile, errfile, executable [, args ...])
    +
    spawn_redirected(infile, outfile, errfile, executable [, args ...])
    Like spawn(), but with standard input, standard output and standard error redirected to the given files. -
    wait(pid)
    +
    wait(pid)
    Wait until the process with given PID (process handle on Win32) exits. Returns two values: a result value and the exit code of the waited-for process. @@ -13346,7 +13396,7 @@ outside of any alternation, it acts exac

    -

    Appendix A Default hooks

    +

    Anhang A Default hooks

    This section contains the entire source code of the standard hook file, that is built in to the monotone executable, and read before any user @@ -13385,7 +13435,7 @@ function execute(path, ...) function execute(path, ...) local pid local ret = -1 - pid = spawn(path, unpack(arg)) + pid = spawn(path, ...) if (pid ~= -1) then ret, pid = wait(pid) end return ret end @@ -13394,7 +13444,7 @@ function execute_redirected(stdin, stdou local pid local ret = -1 io.flush(); - pid = spawn_redirected(stdin, stdout, stderr, path, unpack(arg)) + pid = spawn_redirected(stdin, stdout, stderr, path, ...) if (pid ~= -1) then ret, pid = wait(pid) end return ret end @@ -13404,7 +13454,7 @@ function execute_confirm(path, ...) -- This is needed to work around some brokenness with some merge tools -- (e.g. on OS X) function execute_confirm(path, ...) - ret = execute(path, unpack(arg)) + ret = execute(path, ...) if (ret ~= 0) then @@ -13645,10 +13695,10 @@ function edit_comment(basetext, user_log elseif (program_exists_in_path("editor")) then exe = "editor" elseif (program_exists_in_path("vi")) then exe = "vi" elseif (string.sub(get_ostype(), 1, 6) ~= "CYGWIN" and - program_exists_in_path("notepad.exe")) then exe = "notepad" + program_exists_in_path("notepad.exe")) then exe = "notepad" else io.write(gettext("Could not find editor to enter commit message\n" - .. "Try setting the environment variable EDITOR\n")) + .. "Try setting the environment variable EDITOR\n")) return nil end @@ -13671,22 +13721,22 @@ function edit_comment(basetext, user_log if (not string.find(exe, "[^%w_.+-]")) then -- safe to call spawn directly if (execute(exe, tname) ~= 0) then - io.write(string.format(gettext("Error running editor '%s' ".. - "to enter log message\n"), + io.write(string.format(gettext("Error running editor '%s' ".. + "to enter log message\n"), exe)) - os.remove(tname) - return nil + os.remove(tname) + return nil end else -- must use shell local shell = os.getenv("SHELL") if (shell == nil) then shell = "sh" end if (not program_exists_in_path(shell)) then - io.write(string.format(gettext("Editor command '%s' needs a shell, ".. - "but '%s' is not to be found"), - exe, shell)) - os.remove(tname) - return nil + io.write(string.format(gettext("Editor command '%s' needs a shell, ".. + "but '%s' is not to be found"), + exe, shell)) + os.remove(tname) + return nil end -- Single-quoted strings in both Bourne shell and csh can contain @@ -13694,11 +13744,11 @@ function edit_comment(basetext, user_log local safe_tname = " '" .. string.gsub(tname, "'", "'\\''") .. "'" if (execute(shell, "-c", editor .. safe_tname) ~= 0) then - io.write(string.format(gettext("Error running editor '%s' ".. - "to enter log message\n"), + io.write(string.format(gettext("Error running editor '%s' ".. + "to enter log message\n"), exe)) - os.remove(tname) - return nil + os.remove(tname) + return nil end end @@ -13732,14 +13782,14 @@ end return false end -function get_date_format_spec() +function get_date_format_spec(wanted) -- Return the strftime(3) specification to be used to print dates -- in human-readable format after conversion to the local timezone. -- The default uses the preferred date and time representation for -- the current locale, e.g. the output looks like this: "09/08/2009 - -- 06:49:26 PM" for en_US, or "08.09.2009 18:49:26" for de_DE. - return "%x %X" - + -- 06:49:26 PM" for en_US and "date_time_long", or "08.09.2009" + -- for de_DE and "date_short" + -- -- A sampling of other possible formats you might want: -- default for your locale: "%c" (may include a confusing timezone label) -- 12 hour format: "%d %b %Y, %I:%M:%S %p" @@ -13748,6 +13798,14 @@ function get_date_format_spec() -- ISO 8601: "%Y-%m-%d %H:%M:%S" or "%Y-%m-%dT%H:%M:%S" -- -- ISO 8601, no timezone conversion: "" + --. + if (wanted == "date_long" or wanted == "date_short") then + return "%x" + end + if (wanted == "time_long" or wanted == "time_short") then + return "%X" + end + return "%x %X" end -- trust evaluation hooks @@ -13819,9 +13877,9 @@ mergers.meld = { mergers.meld = { cmd = function (tbl) io.write (string.format("\nWARNING: 'meld' was chosen to perform ".. - "an external 3-way merge.\n".. - "You must merge all changes to the ".. - "*CENTER* file.")) + "an external 3-way merge.\n".. + "You must merge all changes to the ".. + "*CENTER* file.")) local path = "meld" local ret = execute(path, tbl.lfile, tbl.afile, tbl.rfile) if (ret ~= 0) then @@ -13868,9 +13926,9 @@ mergers.vim = { end io.write (string.format("\nWARNING: 'vim' was chosen to perform ".. - "an external 3-way merge.\n".. - "You must merge all changes to the ".. - "*LEFT* file.\n")) + "an external 3-way merge.\n".. + "You must merge all changes to the ".. + "*LEFT* file.\n")) local vim if os.getenv ("DISPLAY") ~= nil and program_exists_in_path ("gvim") then @@ -14754,6 +14812,41 @@ end return push_hook_functions(notifier) end end + +-- to ensure only mapped authors are allowed through +-- return "" from unmapped_git_author +-- and validate_git_author will fail + +function unmapped_git_author(author) + -- replace "address@hidden" with "foo <address@hidden>" + name = author:match("^([^<>]+)@[^<>]+$") + if name then + return name .. " <" .. author .. ">" + end + + -- replace "<address@hidden>" with "foo <address@hidden>" + name = author:match("^<([^<>]+)@[^<>]+>$") + if name then + return name .. " " .. author + end + + -- replace "foo" with "foo <foo>" + name = author:match("^[^<>@]+$") + if name then + return name .. " <" .. name .. ">" + end + + return author -- unchanged +end + +function validate_git_author(author) + -- ensure author matches the "Name <email>" format git expects + if author:match("^[^<]+ <[^>]*>$") then + return true + end + + return false +end @@ -14761,19 +14854,19 @@ end


    -

    Footnotes

    [1] We +

    Fußnoten

    [1] We say sha1 values are “unique” here, when in fact there is a small probability of two different versions having the same sha1 value. This probability is very small, so we discount it.

    ============================================================ # monotone.pdf is binary