Skip to content

Commit

Permalink
s/compare_db.c: print details about added and removed entries
Browse files Browse the repository at this point in the history
  • Loading branch information
hvhaugwitz committed Dec 27, 2010
1 parent 9d49ef3 commit 05d3911
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- print added or removed attributes of changed entries if forced
via report_attributes
- removed obsolete code
- print details about added and removed entries in verbose level 6
or higher, closes feature request 1460461

2010-12-26 Hannes von Haugwitz <hannes@vonhaugwitz.com>
* src/compare_db.c:
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Version post-0.15.1
* Side-by-side output of acl and xattrs values
* Print added or removed attributes of changed entries if forced
via report_attributes
* Print details about added and removed entries in verbose level 6
or higher
* Use '|' to separate the old value from the new one
* Bug fixes

Expand Down
12 changes: 11 additions & 1 deletion src/compare_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,13 @@ static void print_dbline_attributes(db_line* oline, db_line* nline, DB_ATTR_TYPE
}
}

static void print_attributes_added_node(db_line* line, DB_ATTR_TYPE ignored_attrs) {
print_dbline_attributes(NULL, line, line->attr, ignored_attrs ,0);
}

static void print_attributes_removed_node(db_line* line, DB_ATTR_TYPE ignored_attrs) {
print_dbline_attributes(line, NULL, line->attr, ignored_attrs ,0);
}

void print_report_header(int nfil,int nadd,int nrem,int nchg)
{
Expand Down Expand Up @@ -596,8 +603,11 @@ long report_tree(seltree* node,int stage, long* status)
if(top){
error(2,(char*)report_top_format,_("Detailed information about changes"));
}
if(node->checked&NODE_CHANGED){
if (node->checked&NODE_CHANGED) {
print_dbline_attributes(node->old_data, node->new_data, node->changed_attrs, ignorelist, forced_attrs);
} else if ((conf->verbose_level>=6)) {
if (node->checked&NODE_ADDED) { print_attributes_added_node(node->new_data, ignorelist); }
if (node->checked&NODE_REMOVED) { print_attributes_removed_node(node->old_data, ignorelist); }
}
}

Expand Down

0 comments on commit 05d3911

Please sign in to comment.