# # # patch "automate.cc" # from [d9452830c60f213434bd1c280f29de6ebf74e2ac] # to [ba8f8809083f5075933af915f0dc5e18504d3043] # # patch "cmd_ws_commit.cc" # from [a665755b1f2a25a5181f5b46a43f98c902592075] # to [8e8a55dc2e283f4ee01f2b862f38f574d330a9b9] # # patch "monotone.texi" # from [667bb34d81f5a97baaa5988b89bdad77708464b1] # to [a582d518e5e7d64f6089cc1e939023f11c4934b5] # # patch "tests/automate_get_attributes/__driver__.lua" # from [5a33473460065fc97623141b80fac734ae0726c0] # to [9b89d87cc43aa1c5ba5569d495ebfa812d81305f] # # patch "tests/automate_set_drop_attribute/__driver__.lua" # from [2cc985f6c0fe70267b1379c2f9ff87bea57f7353] # to [6de8648b80cc4aeb0c5f08e66dc4b5c7964ce339] # # patch "tests/automate_tags/__driver__.lua" # from [4de41ac9c88300afab57d2e5dd91429f1c93d57e] # to [604372f0b7249666d804da76d32bf3f27bc0f07e] # ============================================================ --- automate.cc d9452830c60f213434bd1c280f29de6ebf74e2ac +++ automate.cc ba8f8809083f5075933af915f0dc5e18504d3043 @@ -1702,9 +1702,6 @@ CMD_AUTOMATE(tags, N_("[BRANCH_PATTERN]" } basic_io::printer prt; - basic_io::stanza stz; - stz.push_str_pair(symbol("format_version"), "1"); - prt.print_stanza(stz); set tags; project.get_tags(tags); ============================================================ --- cmd_ws_commit.cc a665755b1f2a25a5181f5b46a43f98c902592075 +++ cmd_ws_commit.cc 8e8a55dc2e283f4ee01f2b862f38f574d330a9b9 @@ -931,11 +931,6 @@ CMD_AUTOMATE(get_attributes, N_("PATH"), // create the printer basic_io::printer pr; - // print the format version - basic_io::stanza st; - st.push_str_pair(basic_io::syms::format_version, "1"); - pr.print_stanza(st); - // the current node holds all current attributes (unchanged and new ones) node_t n = current.get_node(path); for (attr_map_t::const_iterator i = n->attrs.begin(); ============================================================ --- monotone.texi 667bb34d81f5a97baaa5988b89bdad77708464b1 +++ monotone.texi a582d518e5e7d64f6089cc1e939023f11c4934b5 @@ -6909,7 +6909,9 @@ @section Automation @itemize @item -11.0 -- @var{signer} now prints the hash of the signing key, no longer the name +11.0 -- @var{signer} now prints the hash of the signing key, no longer the name. + Also, the @var{format_version} stanza has been removed in favour of the + global @var{interface_version}. @item 2.2 -- added @end itemize @@ -6927,8 +6929,6 @@ @section Automation @item Sample output: @verbatim -format_version "1" - tag "monotree-0.1" revision [8a121346ce2920b6f85df68b3b620de96bd14a8d] signer [de84b575d5e47254393eba49dce9dc4db98ed42d] @@ -8165,6 +8165,8 @@ @section Automation @itemize @item +11.0 -- removed the @command{format_version} stanza address@hidden 5.0 -- renamed from @command{attributes} to @command{get_attributes} @item 3.0 -- initial @@ -8177,8 +8179,6 @@ @section Automation @item Sample output: @verbatim -format_version "1" - attr "foo" "bar" state "added" @@ -8225,10 +8225,6 @@ @section Automation The complete format: @verbatim -'format_version' - used in case this format ever needs to change. - format: ('format_version', the string "1") - occurs: exactly once 'attr': represents an attribute. format: ('attr', key, value), ('state', [unchanged|changed|added|dropped]) ============================================================ --- tests/automate_get_attributes/__driver__.lua 5a33473460065fc97623141b80fac734ae0726c0 +++ tests/automate_get_attributes/__driver__.lua 9b89d87cc43aa1c5ba5569d495ebfa812d81305f @@ -8,11 +8,7 @@ check(fsize("stderr") == 0) -- at first check for the version on the file w/o attributes check(mtn("automate", "get_attributes", "testfile"), 0, true, true) check(fsize("stderr") == 0) -parsed = parse_basic_io(readfile("stdout")) -for _,l in pairs(parsed) do - if l.name == "format_version" then fversion = l.values[1] end -end -check(fversion == "1") +check(fsize("stdout") == 0) -- add three test attributes and commit them check(mtn("attr", "set", "testfile", "key1", "persists"), 0, false, false) @@ -20,7 +16,7 @@ commit("mainbranch"); check(mtn("attr", "set", "testfile", "key3", "will_be_changed"), 0, false, false) commit("mainbranch"); --- now add another one, drop one of the existing and +-- now add another one, drop one of the existing and -- re-add one of the existing check(mtn("attr", "set", "testfile", "key4", "has_been_added"), 0, false, false) check(mtn("attr", "drop", "testfile", "key3"), 0, false, false) @@ -31,12 +27,12 @@ parsed = parse_basic_io(readfile("stdout check(mtn("automate", "get_attributes", "testfile"), 0, true, true) check(fsize("stderr") == 0) parsed = parse_basic_io(readfile("stdout")) --- make sure the output generated 9 stanzas -check(table.getn(parsed) == 9) +-- make sure the output generated 8 stanzas +check(table.getn(parsed) == 8) lastkey = "" checked = {} for _,l in pairs(parsed) do - if l.name == "attr" then + if l.name == "attr" then lastkey = l.values[1] val = l.values[2] if lastkey == "key1" then check(val == "persists") end @@ -46,20 +42,20 @@ for _,l in pairs(parsed) do end if l.name == "state" then state = l.values[1] - - if lastkey == "key1" then + + if lastkey == "key1" then check(state == "unchanged") checked[lastkey] = true end - if lastkey == "key2" then + if lastkey == "key2" then check(state == "dropped") checked[lastkey] = true end - if lastkey == "key3" then + if lastkey == "key3" then check(state == "changed") checked[lastkey] = true end - if lastkey == "key4" then + if lastkey == "key4" then check(state == "added") checked[lastkey] = true end @@ -76,7 +72,7 @@ for _,l in pairs(parsed) do parsed = parse_basic_io(readfile("stdout")) for _,l in pairs(parsed) do - if l.name == "attr" then + if l.name == "attr" then curkey = l.values[1] check(curkey ~= "key2") end @@ -92,7 +88,7 @@ for _,l in pairs(parsed) do curkey = "" for _,l in pairs(parsed) do - if l.name == "attr" then + if l.name == "attr" then curkey = l.values[1] end if l.name == "state" and curkey == "key2" then ============================================================ --- tests/automate_set_drop_attribute/__driver__.lua 2cc985f6c0fe70267b1379c2f9ff87bea57f7353 +++ tests/automate_set_drop_attribute/__driver__.lua 6de8648b80cc4aeb0c5f08e66dc4b5c7964ce339 @@ -25,9 +25,9 @@ parsed = parse_basic_io(readfile("stdout check(mtn("automate", "get_attributes", "testfile"), 0, true, false) parsed = parse_basic_io(readfile("stdout")) -check(table.getn(parsed) == 3) +check(table.getn(parsed) == 2) for _,l in pairs(parsed) do - if l.name == "attr" then + if l.name == "attr" then key = l.values[1] val = l.values[2] check(key == "foo" and val == "bar") @@ -44,7 +44,7 @@ parsed = parse_basic_io(readfile("stdout -- check if it has been really dropped check(mtn("automate", "get_attributes", "testfile"), 0, true, false) parsed = parse_basic_io(readfile("stdout")) -check(table.getn(parsed) == 1) +check(table.getn(parsed) == 0) -- check if it escalates properly if there is no such attr to drop check(mtn("automate", "drop_attribute", "testfile", "foo"), 1, false, true) ============================================================ --- tests/automate_tags/__driver__.lua 4de41ac9c88300afab57d2e5dd91429f1c93d57e +++ tests/automate_tags/__driver__.lua 604372f0b7249666d804da76d32bf3f27bc0f07e @@ -4,12 +4,8 @@ check(fsize("stderr") == 0) -- automate tags on empty db check(mtn("automate", "tags"), 0, true, true) check(fsize("stderr") == 0) -parsed = parse_basic_io(readfile("stdout")) -for _,l in pairs(parsed) do - if l.name == "format_version" then fversion = l.values[1] end -end -check(fversion ~= nil) - +check(fsize("stdout") == 0) + -- now add something addfile("testfile", "foo") commit("mainbranch") @@ -33,7 +29,7 @@ function get_tag(tag, ...) for _,l in pairs(parsed) do if l.name == "tag" then ltag = l.values[1] end if ltag == tag and l.name == "revision" then - return l.values[1] + return l.values[1] end end return nil