[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] print conflict statistics after update/merge

From: Stefan Sperling <stsp_at_elego.de>
Date: Fri, 17 Oct 2008 16:05:21 +0100

On Fri, Oct 17, 2008 at 04:46:16PM +0200, Jens Seidel wrote:
> On Fri, Oct 17, 2008 at 03:35:27PM +0100, Stefan Sperling wrote:
> > We now support 3 different types of conflicts in trunk (text, prop,
> > tree). I have for been contemplating the idea of reporting how many
> > conflicts of each type occured during an update or merge.
> > Here is a patch that implements this idea.
>
> > More complicated example:
> >
> > --- Merging r2 through r5 into '.':
> > C epsilon
> > Conflict discovered in 'beta'.
> > Select: (p) postpone, (df) diff-full, (e) edit,
> > (mc) mine-conflict, (tc) theirs-conflict,
> > (s) show all options: p
> > C beta
> > C .
> > There was 1 text conflict and 2 tree conflicts.
> > 2 paths were skipped.
>
> I suggest to display skipped paths. Especially if one opened an editor
> to resolve conflicts in the terminal old output may have gone away.

I'm not sure how easy it is to get at the list of skipped
paths from the notification callback. I'll check how difficult
this would be.

Skipped paths are of course still displayed during the
update/merge as they always have been. Granted, that
output has always been scrolling by, so this situation
is not made any worse by the patch as-is (improving this
situation could be done in a separate patch).

>
> > + SVN_ERR(svn_cmdline_printf
> > + (pool, nb->text_conflicts == 1
> > + ? _("There was %i text conflict")
> > + : _("There were %i text conflicts"),
> > + nb->text_conflicts));
>
> The test nb->text_conflicts == 1 is specific to English. Other languages
> have more complicated plural rules (e.g. Russian).

I had similar thoughts about printing the single dot+newline
at the very end. Is this applicable to all languages? If not,
can translators work around this somehow?

> Please use ngettext() instead of gettext() (== _() ).

Ah, I see. Having read the man page for ngettext(3) this
sounds like a good solution.

Instead, we could also opt for printing something more simple,
such as:

  Text conflicts: %i
  Property conflicts: %i
  Tree conflicts: %i

This would also be easier to parse for scripts.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-10-17 17:09:34 CEST

This is an archived mail posted to the Subversion Dev mailing list.