On Mon, Jun 07, 2010 at 03:41:27PM +0200, Stefan Sperling wrote:
> On Mon, Jun 07, 2010 at 12:43:19PM -0000, dannas_at_apache.org wrote:
> > Author: dannas
> > Date: Mon Jun 7 12:43:19 2010
> > New Revision: 952205
> >
> > URL: http://svn.apache.org/viewvc?rev=952205&view=rev
> > Log:
> > Use several smaller functions for printing git diff headers instead of one.
> >
> > * subversion/libsvn_client/diff.c
> > (print_git_diff_header): Split this one into ...
> > (print_git_diff_header_added): ..this ...
> > (print_git_diff_header_deleted): .. and this ...
> > (print_git_diff_header_copied): .. and this ...
> > (print_git_diff_header_moved): .. and this ...
> > (print_git_diff_header_modified): .. and this.
> > (diff_content_changed): Adjust caller.
>
>
> > @@ -681,42 +705,43 @@ diff_content_changed(const char *path,
>
> > + SVN_ERR(print_git_diff_header_deleted(
> > + os,
> > + diff_cmd_baton->header_encoding,
> > + path, subpool));
> > +
> > label1 = diff_label(apr_psprintf(subpool, "a/%s", path1), rev1,
> > subpool);
> > label2 = diff_label("/dev/null", rev2, subpool);
>
> You could make the print_git_diff_headet_* functions return the appropriate
> labels as output parameters. E.g:
>
> SVN_ERR(print_git_diff_header_deleted(
> &label1, &label2, os,
> diff_cmd_baton->header_encoding, path, subpool));
To create labels we need two paths (haven't fully understood why we have
two different paths. How can we invoke 'svn diff' to compare two
different paths to each other?) and two revisions. That's a lot of
parameter passing for only executing two lines. I do want to put the
label creation inside a function but doing it in the
print_git_diff_header_*() seems too bulky.
Hopefully I can change diff_label() once we use 'git diffs' everywhere
and just call it once.
Thanks,
Daniel
Received on 2010-06-07 20:02:31 CEST