# # # patch "ChangeLog" # from [61b3a165a8c986fe988942d7b789841431fadfe3] # to [c32062e828dd79e18a65d1a37dfadaae944ce996] # # patch "automate.cc" # from [3c18e29a2d70546369531bbf9b80aa0faaee507a] # to [31010a960ddc85410dd8ce63c7e930ec32638a80] # # patch "tests/two_parent_workspace_commands_that_fail/__driver__.lua" # from [1a53e327e6673b4539cca9aebba3cc5c25671462] # to [40dba9452f511807830c8dfc5d2db02557a1d11c] # ============================================================ --- ChangeLog 61b3a165a8c986fe988942d7b789841431fadfe3 +++ ChangeLog c32062e828dd79e18a65d1a37dfadaae944ce996 @@ -1,5 +1,9 @@ 2007-02-09 Zack Weinberg + * automate.cc (attributes): Fail gracefully in a two-parent workspace. + * tests/two_parent_workspace_commands_that_fail: Add test for + automate attributes. + * cmd_files.cc (log): Work in a two-parent workspace. * tests/merge_into_workspace: Augment with tests for log. ============================================================ --- automate.cc 3c18e29a2d70546369531bbf9b80aa0faaee507a +++ automate.cc 31010a960ddc85410dd8ce63c7e930ec32638a80 @@ -225,10 +225,15 @@ AUTOMATE(attributes, N_("FILE"), options file_path_external(idx(args,0)).split(path); roster_t base, current; + parent_map parents; temp_node_id_source nis; // get the base and the current roster of this workspace - app.work.get_base_and_current_roster_shape(base, current, nis); + app.work.get_current_roster_shape(current, nis); + app.work.get_parent_rosters(parents); + N(parents.size() == 1, + F("this command can only be used in a single-parent workspace")); + base = *(parents.begin()->second.first); // escalate if the given path is unknown to the current roster N(current.has_node(path), ============================================================ --- tests/two_parent_workspace_commands_that_fail/__driver__.lua 1a53e327e6673b4539cca9aebba3cc5c25671462 +++ tests/two_parent_workspace_commands_that_fail/__driver__.lua 40dba9452f511807830c8dfc5d2db02557a1d11c @@ -41,5 +41,7 @@ check(mtn("update"), 1, nil, diag) check(mtn("revert", "."), 1, nil, diag) check(mtn("update"), 1, nil, diag) +-- formats need updating to deal check(mtn("automate", "get_base_revision_id"), 1, nil, diag) check(mtn("automate", "inventory"), 1, nil, diag) +check(mtn("automate", "attributes", "testfile"), 1, nil, diag)