From 8d10cbfcb13fb20eeb34441365d8b73d4a6b0e41 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 28 Feb 2009 08:02:25 -0800 Subject: [PATCH] Made --progress use ir-chk instead of to-chk when the incremental recursion scan is still active. Mention the output change more prominently in the NEWS file. Updated the --progress output in the manpage, with mention of the new "ir-chk" string's meaning. --- NEWS | 23 ++++++++++++++++++----- flist.c | 7 +++++-- progress.c | 5 +++-- rsync.yo | 14 ++++++++++++-- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 2309aff0..bc44c5ec 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,24 @@ NEWS for rsync 3.1.0 (UNRELEASED) Protocol: 31 (changed) Changes since 3.0.4: + OUTPUT CHANGES: + + - Output numbers in 3-digit groups by default (e.g. 1,234,567). See the + --human-readable option for a way to turn it off. See also the daemon's + "log format" parameter and related command-line options (including + --out-format) for a modifier that can be used to request digit-grouping + or human-readable output in log escapes. (Note that log output is + unchanged by default.) + + - The output of the --progress option has changed: the string "xfer" was + shortened to "xfr", and the string "to-check" was shortened to "to-chk", + both designed to make room for the (by default) wider display of file + size numbers without making the total line-length longer. Also, when + incremental recursion is enabled, the string "ir-chk" will be used + instead of "to-chk" up until the incremental-recursion scan is done, + letting you know that the value to check and the total value will still + be increasing as new files are found. + BUG FIXES: - Changed the way --progress overwrites its prior output in order to make @@ -16,11 +34,6 @@ Changes since 3.0.4: control over what is output. Added an extra type of --progress output using --info=progress2. - - Output numbers in 3-digit groups by default (e.g. 1,234,567). See the - --human-readable option for a way to turn it off. See also the daemon's - "log format" parameter for a modifier that can request digit-grouping or - human-readable output in log escapes (including --out-format). - - Added a "T" (terabyte) category to the --human-readable size suffixes. - Enhanced the --stats output: 1) to mention how many files were created diff --git a/flist.c b/flist.c index 2fdff344..90c0ce50 100644 --- a/flist.c +++ b/flist.c @@ -2310,7 +2310,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) * file-list to check if this is a 1-file xfer. */ send_extra_file_list(f, 1); } - } + } else + flist_eof = 1; return flist; } @@ -2436,8 +2437,10 @@ struct file_list *recv_file_list(int f) if (inc_recurse) flist_done_allocating(flist); - else if (f >= 0) + else if (f >= 0) { recv_id_list(f, flist); + flist_eof = 1; + } flist_sort_and_clean(flist, relative_paths); diff --git a/progress.c b/progress.c index 3fb8e2be..ac010fd9 100644 --- a/progress.c +++ b/progress.c @@ -24,6 +24,7 @@ #include "inums.h" extern int am_server; +extern int flist_eof; extern int need_unsorted_flist; extern int output_needs_newline; extern struct stats stats; @@ -72,8 +73,8 @@ static void rprint_progress(OFF_T ofs, OFF_T size, struct timeval *now, if (is_last) { int len = snprintf(eol, sizeof eol, - " (xfr#%d, to-chk=%d/%d)\n", - stats.xferred_files, + " (xfr#%d, %s-chk=%d/%d)\n", + stats.xferred_files, flist_eof ? "to" : "ir", stats.num_files - current_file_index - 1, stats.num_files); if (INFO_GTE(PROGRESS, 2)) { diff --git a/rsync.yo b/rsync.yo index 4333f903..afa5061c 100644 --- a/rsync.yo +++ b/rsync.yo @@ -2141,15 +2141,25 @@ was finishing the matched part of the file. When the file transfer finishes, rsync replaces the progress line with a summary line that looks like this: -verb( 1238099 100% 146.38kB/s 0:00:08 (xfer#5, to-check=169/396)) +verb( 1,238,099 100% 146.38kB/s 0:00:08 (xfr#5, to-chk=169/396)) -In this example, the file was 1238099 bytes long in total, the average rate +In this example, the file was 1,238,099 bytes long in total, the average rate of transfer for the whole file was 146.38 kilobytes per second over the 8 seconds that it took to complete, it was the 5th transfer of a regular file during the current rsync session, and there are 169 more files for the receiver to check (to see if they are up-to-date or not) remaining out of the 396 total files in the file-list. +In an incremental recursion scan, rsync won't know the total number of files +in the file-list until it reaches the ends of the scan, but since it starts to +transfer files during the scan, it will display a line with the text "ir-chk" +(for incremental recursion check) instead of "to-chk" until the point that it +knows the full size of the list, at which point it will switch to using +"to-chk". Thus, seeing "ir-chk" lets you know that the total count of files +in the file list is still going to increase (and each time it does, the count +of files left to check will increase by the number of the files added to the +list). + dit(bf(-P)) The bf(-P) option is equivalent to bf(--partial) bf(--progress). Its purpose is to make it much easier to specify these two options for a long transfer that may be interrupted. -- 2.34.1