mercurial & lotus

Pjotr Kourzanov peter.kourzanov at
Wed Mar 12 18:05:45 CDT 2008

Dear Mercurial developers,

  I've given Mercurial a try witin our company, and overall I
think it is a very useful and lightweight SCM. However, I have
some questions/suggestions concerning its integration with an
e-mail client that we (and probably many other companies also)
use, namely the Lotus Notes. I know, Lotus is not the preferred
mail client to use, but we have to live with it, hence my mail...

  First of all, the "inline attachments" generated with $hg email
-a command are being inlined by Lotus, making the patches a bit
difficult to export (from Lotus Notes). It would make some sense to
add an option/configuration to $hg email command to generate proper
attachments (Content-Disposition: attachment) rather than inline
attachments so that clients like Lotus Notes feel less inclined to
maim it. In that case, the changegroup can be sent in one e-mail,
with every changeset encapsulated as a (proper) attachment.

  Also, I've noticed that patches generated with $hg mail, or
$hg export command on UNIX systems (i.e., with \n line endings)
and processed by the Lotus Notes e-mail client on a Windows system
tend to fail to apply, because the attachment export procedure in
the Lotus client saves the attachment in a Windows style (with
\r\n line endings). I know this is broken, but it would help if
$hg import command had an "ignore line-endings" option, like the
patch program on UNIX.

  Of course, both issues could be solved by using binary patches
(bundles), but that feels more like a hack... Also, using binary
bundles would make the patch review process more complex. Therefore,
I suggest that the attachment generated by $hg email could
potentially be e.g. compressed with gzip/zip to let clients like
Lotus Notes think that it should not be re-coded into any other
format (maybe this could also be done by using some MIME magic).
It would still allow for some automated patch review, since the user
would only need to "click through" the zip extractor.

  Summarizing, I propose three new options to $hg commands:

1. email: -A or somesuch (meaning: use real attachments)

2. email: -z (--gz), -j (--bz2) or somesuch (meaning: compress 
   attachments with either of gzip of bzip2), this implies -A of

3. import: -s or somesuch (meaning: ignore \r in patch chunks)
   For OSX \n should be ignored...

  Finally, for Mercurial/Tortoise I would suggest including
default associations of the handling for .patch and .hg files
in the install process. That would make integration with clients
like Lotus Notes even more seamless...

Kind regards,

Pjotr Kourzanov

P.S. I know that my issue with line endings can be solved by
     converting repository checkouts to one (local system specific)
     format. However, I would rather not do it, since that would
     require every site to tweak their configuration (hgrc). That
     is unless official installation of Mercurial would include
     this feature by default...

More information about the Mercurial mailing list