# # # patch "NEWS" # from [00d565cdeaaad2346e7305e626e0a7e2bf22f00e] # to [9698da922df0c146edddcc153aedc11b73e173f2] # # patch "database.cc" # from [4ae4c79a2a7fba4f39b072de6edc52625e1f69c0] # to [b37f89c9d264b674728fda144360e30d5d3b6397] # # patch "monotone.texi" # from [ba3e94933926c735fe99c81024701beaaef7203a] # to [9bdc10fe42bccd03dae526214854bc4d08f863b5] # # patch "selectors.cc" # from [87df1393159bdc637059d9dfa9dfc52d50236326] # to [1f5468137482871fb0c6b418357caa93eed01201] # # patch "selectors.hh" # from [a580067010375b01e72094ebc255e26da4894384] # to [04a1e8390e95624c89c100fd14de9157f5309dc1] # ============================================================ --- NEWS 00d565cdeaaad2346e7305e626e0a7e2bf22f00e +++ NEWS 9698da922df0c146edddcc153aedc11b73e173f2 @@ -28,6 +28,12 @@ merge_into_workspace" this way one especially can achieve a CVS/SVN style non-modal workspace-based merging. + - an additional selector type "p" for selecting parent + revision(s) was added. This is especially handy in situations + like "mtn diff -r p: -r ", because one no + longer has to figure out the parent revision manually via "mtn + automate parents " beforehand. + Bugs fixed - mtn automate heads called without a branch argument now properly ============================================================ --- database.cc 4ae4c79a2a7fba4f39b072de6edc52625e1f69c0 +++ database.cc b37f89c9d264b674728fda144360e30d5d3b6397 @@ -2874,6 +2874,7 @@ static void selector_to_certname(selecto case selectors::sel_ident: case selectors::sel_cert: case selectors::sel_unknown: + case selectors::sel_parent: I(false); // don't do this. break; } @@ -2914,6 +2915,11 @@ void database::complete(selector_type ty lim.sql_cmd += "SELECT id FROM revision_certs WHERE id GLOB ?"; lim % text(i->second + "*"); } + else if (i->first == selectors::sel_parent) + { + lim.sql_cmd += "SELECT parent AS id FROM revision_ancestry WHERE child GLOB ?"; + lim % text(i->second + "*"); + } else if (i->first == selectors::sel_cert) { if (i->second.length() > 0) @@ -3033,7 +3039,7 @@ void database::complete(selector_type ty // will complete either some idents, or cert values, or "unknown" // which generally means "author, tag or branch" - if (ty == selectors::sel_ident) + if (ty == selectors::sel_ident || ty == selectors::sel_parent) { lim.sql_cmd = "SELECT id FROM " + lim.sql_cmd; } ============================================================ --- monotone.texi ba3e94933926c735fe99c81024701beaaef7203a +++ monotone.texi 9bdc10fe42bccd03dae526214854bc4d08f863b5 @@ -2765,6 +2765,10 @@ @heading Selectors in detail @item Identifier selection Uses selector type @code{i}. For example, @code{i:0f3a} matches revision IDs which begin with @code{0f3a}. address@hidden Parent selection +Uses selector type @code{p}. For example, @code{p:0f3a} matches the +revision IDs which are the parent of the revision ID which begins with address@hidden @item Tag selection Uses selector type @code{t}. For example, @code{t:monotone-0.11} matches @code{tag} certs where the cert value begins with @code{monotone-0.11}. ============================================================ --- selectors.cc 87df1393159bdc637059d9dfa9dfc52d50236326 +++ selectors.cc 1f5468137482871fb0c6b418357caa93eed01201 @@ -79,6 +79,9 @@ namespace selectors case 'e': type = sel_earlier; break; + case 'p': + type = sel_parent; + break; default: W(F("unknown selector type: %c") % sel[0]); break; ============================================================ --- selectors.hh a580067010375b01e72094ebc255e26da4894384 +++ selectors.hh 04a1e8390e95624c89c100fd14de9157f5309dc1 @@ -30,6 +30,7 @@ namespace selectors sel_cert, sel_earlier, sel_later, + sel_parent, sel_unknown } selector_type;