Note:

This page is primarily intended for developers of Mercurial.

Note:

This page is no longer relevant but is kept for historical purposes.

It's occassionally been desirable to add additional information to the changelog. Unfortunately, the current format is difficult to extend without confusing older hg clients.

The current format looks like this:

<manifest hash>\n
<user>\n
<time> <timezone>\n
file1\n
file2\n
file3\n
...
\n
comment text
...

Everything after the first double newline is the comment. Everything from line 3 to the double newline is the file list. And all the other lines are accounted for. Fortunately, the third line with the time stamp is not used in its entirety. The first two fields are parsed out. So to extend our field, we need to stick some extra data after timezone and before the newline.

Our extra data cannot contain newlines, so it needs to be escaped. For extensibility, it should also have named fields. Something like:

key1:value1\0
key2:value2\0
key3:value3

Escape sequences:

\\ -> \
\n -> linefeed
\r -> carriage return

Note that NUL is used as a separator to avoid extra newlines that would need escaping. After escaping, this extra data can be inserted in the changelog here:

<time> <timezone> <extra>\n

A preliminary patch is available here: http://perso.ens-lyon.fr/benoit.boissinot/extendedchangelog.diff


ExtendedChangelog (last edited 2012-10-25 21:04:07 by mpm)