diff options
author | Lennart Poettering <lennart@poettering.net> | 2003-09-09 17:06:08 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2003-09-09 17:06:08 +0000 |
commit | 916172ab494c57658317f590ed2292f9d613e09a (patch) | |
tree | aa182697b5069f04bd5834b206c3dedc7f8b93f6 /src | |
parent | 91eb75d86018b42f3979d4d5215bea49537776ff (diff) |
prepared for release 0.2
git-svn-id: file:///home/lennart/svn/public/syrep/trunk@38 07ea20a6-d2c5-0310-9e02-9ef735347d72
Diffstat (limited to 'src')
-rw-r--r-- | src/diff.c | 15 | ||||
-rw-r--r-- | src/dump.c | 2 | ||||
-rw-r--r-- | src/merge.c | 15 |
3 files changed, 19 insertions, 13 deletions
@@ -301,19 +301,25 @@ static int list_cb(DB *ddb, struct syrep_name *name, struct diff_entry *de, void switch (de->action) { case DIFF_COPY: { char d[33]; - char src, dst; + char dst; + int mf; + + if ((mf = get_current_nrecno_by_md(de->repository == cb_info->c1 ? cb_info->c2 : cb_info->c1, + de->repository == cb_info->c1 ? &md1 : &md2, NULL)) < 0) + return -1; if (de->repository == cb_info->c1) { - src = 'A'; dst = 'B'; + dst = 'B'; fhex_md5(md1.digest, d); } else { - src = 'B'; dst = 'A'; + dst = 'A'; fhex_md5(md2.digest, d); } d[32] = 0; + + printf("COPY <%s|%s> TO %c%s\n", d, name->path, dst, mf ? " (LINK POSSIBLE)" : ""); - printf("COPY <%s|%s> FROM %c TO %c\n", d, name->path, src, dst); break; } @@ -333,7 +339,6 @@ static int list_cb(DB *ddb, struct syrep_name *name, struct diff_entry *de, void printf("DELETE <%s|%s> FROM %c\n", d, name->path, rep); break; - } case DIFF_CONFLICT: { @@ -1,7 +1,5 @@ /* $Id$ */ -/* $Id$ */ - /*** This file is part of syrep. diff --git a/src/merge.c b/src/merge.c index 01e1981..5741d83 100644 --- a/src/merge.c +++ b/src/merge.c @@ -211,7 +211,9 @@ static int copy_phase(DB *ddb, struct syrep_name *name, struct diff_entry *de, v if (f) { char path2[PATH_MAX+1]; snprintf(path2, sizeof(path2), "%s/%s", cb_info->root, name2.path); - fprintf(stderr, "COPY: Linking existing file <%s> to <%s>.\n", name2.path, name->path); + + if (args.verbose_flag) + fprintf(stderr, "COPY: Linking existing file <%s> to <%s>.\n", name2.path, name->path); if (makeprefixpath(path, 0777) < 0) return -1; @@ -229,9 +231,8 @@ static int copy_phase(DB *ddb, struct syrep_name *name, struct diff_entry *de, v if (!access(path2, R_OK)) { if (copy_or_link_file(path2, path, de->action == DIFF_REPLACE) < 0) return -1; - } - - fprintf(stderr, "COPY: Local file <%s> vanished. Snapshot not up to date.\n", name2.path); + } else + fprintf(stderr, "COPY: Local file <%s> vanished. Snapshot not up to date.\n", name2.path); } } else { @@ -242,7 +243,8 @@ static int copy_phase(DB *ddb, struct syrep_name *name, struct diff_entry *de, v return -1; if (k) { - fprintf(stderr, "COPY: Copying file <%s> from patch.\n", name->path); + if (args.verbose_flag) + fprintf(stderr, "COPY: Copying file <%s> from patch.\n", name->path); if (makeprefixpath(path, 0777) < 0) return -1; @@ -250,7 +252,8 @@ static int copy_phase(DB *ddb, struct syrep_name *name, struct diff_entry *de, v if (copy_or_link_file(a, path, de->action == DIFF_REPLACE) < 0) return -1; } else - fprintf(stderr, "COPY: File <%s> is missing.\n", name->path); + if (args.verbose_flag) + fprintf(stderr, "COPY: File <%s> is missing.\n", name->path); } return 0; |