[PATCH 2 of 2 STABLE] merge: improve error detection and reporting

Greg Ward greg-hg at gerg.ca
Sun May 2 11:02:38 CDT 2010


On Sun, May 2, 2010 at 10:48 AM, I wrote:
> # HG changeset patch
> # User Greg Ward <greg-hg at gerg.ca>
> # Date 1272811643 14400
> # Branch stable
> # Node ID 89413f695c67fc7c03814ce94dba480773c8cfde
> # Parent  b344ddac6247c92150da4187b3365ab2f2442abd
> merge: improve error detection and reporting.
> - make hg exit with non-zero status when branch has 1 or >2 heads
> - tweak the error messages for those cases
> - add explicit detection of merging current changeset with itself
> - rewrite messages for attempting to merge with ancestor or descendant
>  of current changeset

Oh yeah, I have one other question about this patch.  Namely:
> +        errprefix = _('nothing to merge')
> +        errself = _('attempt to merge current changeset with itself')
> +        errancestor = _('attempt to merge with an ancestor of the working dir')
> +        errdesc = _('attempt to merge with a descendant of the working dir')
[...]
> +            if p1 == p2:
> +                raise util.Abort('%s\n(%s)' % (errprefix, errself))
> +            elif pa == p2:
> +                raise util.Abort('%s\n(%s)' % (errprefix, errancestor))

I did things like this mainly to make everything fit in 80 columns.  I
think it means that translators only have to translate "nothing to
merge" once.  But it means that the general form of the messages:

  <high-level explanation>
  (<more details>)

is not open to translation: all languages get the newline and parens,
whether they like it or not.  I'm not sure if *that* is a good thing.
Translators: am I making your lives harder or easier here?

Thanks --

Greg


More information about the Mercurial-devel mailing list