#291: - Compile --exclude/--include/--exclude-from/--include-from into the SAME ordered rule list as --filter/-f (first match wins), so the common `--include='*.txt' --exclude='*'` idiom and include-alone semantics match rsync. The legacy per-kind scanner arrays are no longer applied. - -x/--one-file-system emits the cross-device mount-point directory entry (empty) instead of dropping it, in both the sequential and parallel scanners. - Stop passing the legacy arrays to the scanner; document -f is --filter. #292: - New src/shared/format.c/.h: rsync "big_num" (comma-grouped integers) and decimal -h human sizes, %M/%t timestamp, and the STATUS_DEST_INFO codec. - Receiver answers each STATUS_CHECK with a pre-transfer destination snapshot (new report_dest_info wire field + STATUS_DEST_INFO, PROTOCOL_VERSION 2.23.0) so the sender can render true itemize columns. - Itemize now emits rsync-correct update/type chars and c/s/t/p/o/g columns for files, dirs, symlinks and hard links, comparing size/time/perms/owner/ group against the reported destination. - --out-format gains %i %n %f %l %b %M %t %o %p %B %U %G %L; %f is the relative display path, %M the YYYY/MM/DD-HH:MM:SS form, %b the literal bytes sent. - --list-only prints transfer-relative names, directory entries and ls-style grouped sizes. - --stats prints rsync's multi-line block on stdout; -h uses decimal units. Tests: unit tests for the filter ordering, format primitives, itemize columns; integration + differential tests against real rsync 3.4.1 for itemize/out-format/list-only/selection and -x. Golden wire len/hash and protocol version strings updated for 2.23.0.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "delay_updates.h"
|
||||
#include "delta.h"
|
||||
#include "file.h"
|
||||
#include "format.h"
|
||||
#include "identity.h"
|
||||
#include "log.h"
|
||||
#include "metadata.h"
|
||||
@@ -1858,6 +1859,33 @@ static IncrementalCheckOutcome incremental_check_open_destination(IncrementalChe
|
||||
return INCREMENTAL_CONTINUE;
|
||||
}
|
||||
|
||||
/* Output parity (protocol 2.23.0): when the wire config asked for it, report a
|
||||
snapshot of the pre-transfer destination entry BEFORE the ordinary verdict so
|
||||
the sender can render rsync-accurate -i/--out-format columns. A missing
|
||||
destination is reported explicitly (existed=false) rather than omitted, so
|
||||
the sender can distinguish "new" from "unknown". */
|
||||
static IncrementalCheckOutcome incremental_check_report_dest_info(IncrementalCheckState* state) {
|
||||
if (!state->config->report_dest_info)
|
||||
return INCREMENTAL_CONTINUE;
|
||||
OutputDestState info;
|
||||
memset(&info, 0, sizeof(info));
|
||||
info.known = true;
|
||||
info.existed = state->has_old_file;
|
||||
if (state->has_old_file) {
|
||||
info.size = (unsigned long long)state->old_st.st_size;
|
||||
info.mtime_sec = (long long)state->old_st.st_mtime;
|
||||
#ifdef __linux__
|
||||
info.mtime_nsec = state->old_st.st_mtim.tv_nsec;
|
||||
#endif
|
||||
info.mode = (uint32_t)state->old_st.st_mode;
|
||||
info.uid = (int32_t)state->old_st.st_uid;
|
||||
info.gid = (int32_t)state->old_st.st_gid;
|
||||
}
|
||||
if (!send_status(state->fd, STATUS_DEST_INFO) || !format_dest_state_send(state->fd, &info))
|
||||
return INCREMENTAL_ERROR;
|
||||
return INCREMENTAL_CONTINUE;
|
||||
}
|
||||
|
||||
/* Metadata-only (and, when --checksum forces it, content) up-to-date decision.
|
||||
Loads the old contents only when a checksum comparison or delta needs them. */
|
||||
static IncrementalCheckOutcome incremental_check_quick_skip(IncrementalCheckState* state,
|
||||
@@ -2302,6 +2330,10 @@ File* receive_incremental_check_ex(int fd, const Config* config, bool* skipped,
|
||||
if (outcome == INCREMENTAL_ERROR)
|
||||
goto done;
|
||||
|
||||
outcome = incremental_check_report_dest_info(&state);
|
||||
if (outcome == INCREMENTAL_ERROR)
|
||||
goto done;
|
||||
|
||||
outcome = incremental_check_quick_skip(&state, &try_delta);
|
||||
if (outcome == INCREMENTAL_ERROR)
|
||||
goto done;
|
||||
|
||||
Reference in New Issue
Block a user