monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] net.venge.monotone: 649eb10a3481b527990a261b6e


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone: 649eb10a3481b527990a261b6e6297020d9aed22
Date: Sat, 5 Feb 2011 00:40:19 GMT

revision:            649eb10a3481b527990a261b6e6297020d9aed22
date:                2011-02-05T00:40:00
author:              address@hidden
branch:              net.venge.monotone
changelog:
* src/option.cc (set_from_command_line): do not auto-complete
  single-letter (short) options (fixes issue 141)
* test/func/complete_option_names/__driver__.lua: fix a test
  where we actually built upon that completion
* NEWS: note the change

manifest:
format_version "1"

new_manifest [4e998756316b6606839458394707cc3e0e81eaba]

old_revision [6c3c69d2d3086e527ad3f7f998052e4115b506f9]

patch "NEWS"
 from [ab2fdf60dfbc30606d0384f6130790f3c227a6a3]
   to [816c8281092cdc5fa5d9d0b7c345da5b53ce33da]

patch "src/option.cc"
 from [ad959ae449e8660c8dc25a8015b6b42baf01f69e]
   to [fb39681109f980612386ffa8d09300a142deb672]

patch "test/func/complete_option_names/__driver__.lua"
 from [6636a710b25edb29c970a2f79241430c008c4470]
   to [b88d3308d7d82ef60331bed5550bd4d69be2abcf]
============================================================
--- NEWS	ab2fdf60dfbc30606d0384f6130790f3c227a6a3
+++ NEWS	816c8281092cdc5fa5d9d0b7c345da5b53ce33da
@@ -29,6 +29,10 @@ XXX XXX XX XX:XX:XX UTC 2010
           messages from mtn automate, regardless of the locale of the
           calling process.
 
+        - Short options ('-b', '-d', ...) are no longer completed.  This
+          fixes an invariant failure originating from wrong option usage.
+          (closes monotone issue 141)
+
         New Features
 
         - 'mtn conflicts store' now outputs a count of the conflicts,
@@ -88,7 +92,7 @@ XXX XXX XX XX:XX:XX UTC 2010
           get_default_database_glob(), is used to determine a pattern
           which matches accepted database filenames and this pattern
           by default accept files ending with both, ".mtn" and ".db".
-          (fixes monotone issue 128) 
+          (fixes monotone issue 128)
 
         Internal
 
============================================================
--- src/option.cc	ad959ae449e8660c8dc25a8015b6b42baf01f69e
+++ src/option.cc	fb39681109f980612386ffa8d09300a142deb672
@@ -457,7 +457,11 @@ void concrete_option_set::from_command_l
         {
           name = idx(args,i)().substr(1,1);
 
-          o = getopt(by_name, name);
+          map<string, concrete_option>::const_iterator j = by_name.find(name);
+          if (j == by_name.end())
+            throw unknown_option(name);
+          o = j->second;
+
           is_cancel = (name == o.cancelname);
           I(!is_cancel);
           if (!o.has_arg && idx(args,i)().size() != 2)
============================================================
--- test/func/complete_option_names/__driver__.lua	6636a710b25edb29c970a2f79241430c008c4470
+++ test/func/complete_option_names/__driver__.lua	b88d3308d7d82ef60331bed5550bd4d69be2abcf
@@ -16,7 +16,7 @@ check(qgrep("option 'no-hidden' does not
 check(mtn("help", "--no-h=arg"), 1, false, true)
 check(qgrep("option 'no-hidden' does not take an argument", "stderr"))
 
-check(mtn("version", "-f"), 1, false, true)
+check(mtn("version", "--f"), 1, false, true)
 check(qgrep("option 'f' has multiple ambiguous expansions", "stderr"))
 
 -- ensure that exact option name matches are not matched against

reply via email to

[Prev in Thread] Current Thread [Next in Thread]