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

Re: [PATCH] svnsync fractional progress reporting.

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2007-03-12 15:17:58 CET

C. Michael Pilato wrote:
> I don't care much for the UI that results from this patch, but I figured I'd
> post it here in case someone else is interesting in running with it.
>
> <<<
> Add fractional progress reporting to 'svnsync sync'. This results in
> output like the following:
>
> Committed revision 21 [1/10].
> Copied properties for revision 21.
> Committed revision 22 [2/10].
> Copied properties for revision 22.
> ...
> Copied properties for revision 28.
> Committed revision 29 [9/10].
> Copied properties for revision 29.
> Committed revision 30 [10/10].
> Copied properties for revision 30.

And the rest of the log message (doh!):

* subversion/svnsync/main.c
  (sync_baton_t): Add 'num_commits' and 'target_num_commits' members.
  (commit_callback): Increment the 'num_commits' count, and add a
    fractional progress report to the end of each print line.
  (do_synchronize): Initialize the 'num_commits' and 'target_num_commits'
    baton members.

> ------------------------------------------------------------------------
>
> Index: subversion/svnsync/main.c
> ===================================================================
> --- subversion/svnsync/main.c (revision 23751)
> +++ subversion/svnsync/main.c (working copy)
> @@ -900,6 +900,8 @@
> svn_ra_callbacks2_t *sync_callbacks;
> const char *to_url;
> svn_revnum_t committed_rev;
> + int num_commits;
> + int target_num_commits;
> } sync_baton_t;
>
>
> @@ -911,12 +913,11 @@
> {
> sync_baton_t *sb = baton;
>
> - SVN_ERR(svn_cmdline_printf(pool, _("Committed revision %ld.\n"),
> - commit_info->revision));
> -
> + sb->num_commits++;
> sb->committed_rev = commit_info->revision;
> -
> - return SVN_NO_ERROR;
> + return svn_cmdline_printf(pool, _("Committed revision %ld [%d/%d].\n"),
> + commit_info->revision, sb->num_commits,
> + sb->target_num_commits);
> }
>
>
> @@ -1084,7 +1085,8 @@
>
> /* Ok, so there are new revisions, iterate over them copying them
> into the destination repository. */
> -
> + baton->target_num_commits = (int)(from_latest - atol(last_merged_rev->data));
> + baton->num_commits = 0;
> for (current = atol(last_merged_rev->data) + 1;
> current <= from_latest;
> ++current)

-- 
C. Michael Pilato <cmpilato@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on Mon Mar 12 15:18:10 2007

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.