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: a1dce5694adb69785d53ff8ffa


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone: a1dce5694adb69785d53ff8ffaa2f7f762ed3383
Date: Sat, 5 Feb 2011 02:50:34 GMT

revision:            a1dce5694adb69785d53ff8ffaa2f7f762ed3383
date:                2011-02-05T02:44:44
author:              Richard Levitte <address@hidden>
branch:              net.venge.monotone
changelog:
First move of contributed nugget to something that's officially
distributed and tested with monotone.

* extra/shell/monotone.bash_completion.in: Renamed from
  contrib/monotone.bash_completion2, and with the command tabled replaced
  with '@generated-command-list@' to have it build automatically.
* extra/shell/monotone_gen_bash_completion_table.pl: Renamed from
  contrib/monotone_gen_bash_completion_table.pl.  All debug printouts
  commented away.
* Makefile.am (sysconf_DATA): Add this variable and populate it.
  (do_subst): expand to substitute sysconfdir as well.
  (extra/shell/monotone.bash_completion): Add target, built from
  extra/shell/monotone.bash_completion.in
* test/extra/bash_completion/__driver__.lua: Added test driver.
* test/extra/bash_completion/complete_commit.exp,
  test/extra/bash_completion/complete_propagate.exp,
  test/extra/bash_completion/library.exp: Added tests that use expect.

manifest:
format_version "1"

new_manifest [8a6e2600e9675814dd5f2235feb41968c8d966a8]

old_revision [248fbc8cce8b57fd6116422fb3ff5bae81b5f873]

rename "contrib/monotone.bash_completion2"
    to "extra/shell/monotone.bash_completion.in"

rename "contrib/monotone_gen_bash_completion_table.pl"
    to "extra/shell/monotone_gen_bash_completion_table.pl"

add_dir "extra"

add_dir "extra/shell"

add_dir "test/extra/bash_completion"

add_file "test/extra/bash_completion/__driver__.lua"
 content [8fd46d0044012ef2a1686aa2ffe4c5729071198c]

add_file "test/extra/bash_completion/complete_commit.exp"
 content [439e4abfd8e54e82a86bc7d131fc3f4d2d22eb7b]

add_file "test/extra/bash_completion/complete_mtn_-.exp"
 content [5518c9ce3d09dafac3f3b9e9f8493811f71846c9]

add_file "test/extra/bash_completion/complete_propagate.exp"
 content [409ea6ac7a02318153e0aaf92f28232e8de2465f]

add_file "test/extra/bash_completion/library.exp"
 content [d77b4b981f9f7c170f039c090fabfc8ab3b2d416]

patch "Makefile.am"
 from [414b97f32109bb3e1aaaaf57d10fcab973b83698]
   to [8f16b42b2e1f5193869adc53ea62c67dcfd5a8a6]

patch "extra/shell/monotone.bash_completion.in"
 from [18d37b298ebc9dd1916e04cad7aaffd1d7a300d8]
   to [951b588feba845aadff173e137619a4315820d37]

patch "extra/shell/monotone_gen_bash_completion_table.pl"
 from [65876d0a667e0282a74d20f26a5b26677b25df81]
   to [543ae9c64ec5db10f3bdd05090e3d2a5cdb0273b]
============================================================
--- Makefile.am	414b97f32109bb3e1aaaaf57d10fcab973b83698
+++ Makefile.am	8f16b42b2e1f5193869adc53ea62c67dcfd5a8a6
@@ -250,6 +250,8 @@ htmlimage_DATA = $(PNG_IMAGES)
 htmlimagedir = $(htmldir)/images
 htmlimage_DATA = $(PNG_IMAGES)
 
+sysconf_DATA = extra/shell/monotone.bash_completion
+
 # flags
 
 # sets DEFS for just this object (autoconf's -DHAVE_CONFIG_H is useless)
@@ -631,12 +633,22 @@ test/src/testlib.cc: test/src/testlib.lu
 test/src/testlib.cc: test/src/testlib.lua util/txt2c$(EXEEXT)
 	$(V_txt2c)./util/txt2c testlib $< $@
 
-# Support for scripts
-do_subst = sed -e 's,address@hidden@],$(PACKAGE_VERSION),'
+# Support for scripts and extras
+do_subst = sed -e 's,address@hidden@],$(PACKAGE_VERSION),' \
+	-e 's,address@hidden@],$(sysconfdir),'
 
 %: src/util/%.in
 	$(V_subst)$(do_subst) < $< > $@ && chmod +x $@
 
+extra/shell/monotone.bash_completion: extra/shell/monotone.bash_completion.in \
+	$(bin_PROGRAMS) extra/shell/monotone_gen_bash_completion_table.pl
+	$(MKDIR_P) extra/shell
+	( sed -e '/address@hidden@]$$/,$$d' < $<; \
+	  MTN=./mtn$(EXEEXT) \
+	    perl $(srcdir)/extra/shell/monotone_gen_bash_completion_table.pl; \
+	  sed -e '1,/address@hidden@]$$/d' < $< ) | \
+	  $(do_subst) > $@
+
 # This is phony, so that we always try to rebuild it.  If it succeeds
 # in calculating changes, it produces its target; otherwise, its
 # target does not exist.
============================================================
--- contrib/monotone.bash_completion2	18d37b298ebc9dd1916e04cad7aaffd1d7a300d8
+++ extra/shell/monotone.bash_completion.in	951b588feba845aadff173e137619a4315820d37
@@ -20,421 +20,7 @@
 # mtn is used (you can use the environment variable MTN to point at the right
 # one).
 # BEGIN ----------------------------------------------------------------------
-declare -a _monotone_options_noarg
-_monotone_options_noarg=(
-    --allow-default-confdir
-    --allow-workspace
-    --bookkeep-only
-    --brief
-    --builtin-rcfile
-    --clear-from
-    --clear-rcfiles
-    --clear-to
-    --concise
-    --context
-    --corresponding-renames
-    --diffs
-    --drop-bad-certs
-    --dry-run
-    --external
-    --files
-    --force-duplicate-key
-    --formatted
-    --full
-    --graph
-    --help
-    --hidden
-    --ignore-suspend-certs
-    --ignored
-    --interactive
-    --log-certs
-    --log-revids
-    --merges
-    --missing
-    --move-conflicting-paths
-    --no-brief
-    --no-builtin-rcfile
-    --no-corresponding-renames
-    --no-default-confdir
-    --no-diffs
-    --no-dry-run
-    --no-files
-    --no-format-dates
-    --no-graph
-    --no-hidden
-    --no-ignore-suspend-certs
-    --no-ignored
-    --no-log-certs
-    --no-log-revids
-    --no-merges
-    --no-move-conflicting-paths
-    --no-pid-file
-    --no-recursive
-    --no-resolve-conflicts
-    --no-respect-ignore
-    --no-set-default
-    --no-show-encloser
-    --no-standard-rcfiles
-    --no-unchanged
-    --no-unknown
-    --no-update
-    --no-workspace
-    --non-interactive
-    --plain
-    --quiet
-    --recursive
-    --resolve-conflicts
-    --respect-ignore
-    --reverse
-    --revs-only
-    --set-default
-    --show-encloser
-    --standard-rcfiles
-    --timestamps
-    --unchanged
-    --unified
-    --unknown
-    --update
-    --use-default-key
-    --use-one-changelog
-    --verbose
-    --version
-    --with-header
-    --without-header
-    -R
-    -h
-    -q
-    -v
-)
-declare -a _monotone_options_arg
-_monotone_options_arg=(
-    --author
-    --authors-file
-    --automate-stdio-size
-    --bind
-    --branch
-    --branches-file
-    --confdir
-    --conflicts-file
-    --date
-    --date-format
-    --db
-    --depth
-    --diff-args
-    --drop-attr
-    --dump
-    --exclude
-    --export-marks
-    --from
-    --import-marks
-    --key
-    --key-to-push
-    --keydir
-    --last
-    --log
-    --message
-    --message-file
-    --next
-    --pid-file
-    --rcfile
-    --refs
-    --remote-stdio-host
-    --resolve-conflicts-file
-    --revision
-    --root
-    --ssh-sign
-    --ticker
-    --to
-    --xargs
-    -@
-    -b
-    -d
-    -k
-    -m
-    -r
-)
-declare -A _monotone_options_arg_fns
-_monotone_options_arg_fns=(
-    [--authors-file]=_filedir
-    [--bind]=_monotone_address_port
-    [--branch]=_monotone_branches [-b]=_monotone_branches
-    [--branches-file]=_filedir
-    [--confdir]=_monotone_dir
-    [--conflicts-file]=_filedir
-    [--db]=_filedir [-d]=_filedir
-    [--dump]=_filedir
-    [--export-marks]=_filedir
-    [--from]=_monotone_revision
-    [--import-marks]=_filedir
-    [--keydir]=_monotone_dir
-    [--key]=_monotone_key [-k]=_monotone_public_key
-    [--key-to-push]=_monotone_public_key
-    [--log]=_filedir
-    [--message_file]=_filedir
-    [--pid-file]=_filedir
-    [--rcfile]=_filedir
-    [--refs]=_monotone_refs
-    [--remote-stdio-host]=_monotone_address_port
-    [--resolve-conflicts-file]=_filedir
-    [--revision]=_monotone_revision [-r]=_monotone_revision
-    [--root]=_monotone_dir
-    [--ssh-sign]=_monotone_ssh_sign
-    [--ticker]=_monotone_ticker
-    [--xargs]=_filedir
-    address@hidden
-)
-declare -A _monotone_aliases
-_monotone_aliases['mtn au']='mtn automate'
-_monotone_aliases['mtn di']='mtn diff'
-_monotone_aliases['mtn ls']='mtn list'
-_monotone_aliases['mtn list dbs']='mtn list databases'
-declare -A _monotone_command_options
-declare -A _monotone_command_args
-declare -A _monotone_commands
-_monotone_commands['mtn']='add annotate approve asciik attr automate bisect cat cert checkout ci cleanup_workspace_list clone co comment commit complete conflicts cvs_import db di diff disapprove drop dropkey explicit_merge fdiff fload fmerge genkey get_roster git_export heads help identify import list local log manpage merge merge_into_dir merge_into_workspace migrate_workspace mkdir mv passphrase pivot_root pluck privkey propagate pubkey pull push rcs_import read refresh_inodeprints register_workspace rename revert rm serve set setup show_conflicts ssh_agent_add ssh_agent_export status suspend sync tag testresult trusted undrop unregister_workspace unset update version'
-_monotone_command_options['mtn']='--allow-default-confdir --allow-workspace --builtin-rcfile --clear-rcfiles --confdir --date-format --db --dump --help --ignore-suspend-certs --interactive --key --keydir --log --no-builtin-rcfile --no-default-confdir --no-format-dates --no-ignore-suspend-certs --no-standard-rcfiles --no-workspace --non-interactive --quiet --rcfile --root --ssh-sign --standard-rcfiles --ticker --timestamps --use-default-key --verbose --version --xargs -@ -d -h -k -q -v'
-_monotone_command_args['mtn add']='PATH ...'
-_monotone_command_options['mtn add']='--no-recursive --no-respect-ignore --no-unknown --recursive --respect-ignore --unknown -R'
-_monotone_command_args['mtn annotate']='PATH'
-_monotone_command_options['mtn annotate']='--revision --revs-only -r'
-_monotone_command_args['mtn approve']='REVISION'
-_monotone_command_options['mtn approve']='--branch --no-update --update -b'
-_monotone_command_args['mtn asciik']='SELECTOR'
-_monotone_commands['mtn attr']='drop get set'
-_monotone_command_args['mtn attr drop']='PATH ATTR'
-_monotone_command_args['mtn attr get']='PATH ATTR'
-_monotone_command_args['mtn attr set']='PATH ATTR VALUE'
-_monotone_commands['mtn automate']='ancestors ancestry_difference branches cert certs checkout children common_ancestors content_diff descendents drop_attribute drop_db_variables drop_public_key erase_ancestors file_merge generate_key get_attributes get_base_revision_id get_content_changed get_corresponding_path get_current_revision get_current_revision_id get_db_variables get_extended_manifest_of get_file get_file_of get_file_size get_manifest_of get_option get_public_key get_revision get_workspace_root graph heads identify interface_version inventory keys leaves log lua packet_for_fdata packet_for_fdelta packet_for_rdata packets_for_certs parents pull push put_file put_public_key put_revision read_packets remote remote_stdio roots select set_attribute set_db_variable show_conflicts stdio sync tags toposort update'
-_monotone_command_args['mtn automate ancestors']='REV1 REV2 REV3 ...'
-_monotone_command_args['mtn automate ancestry_difference']='NEW_REV OLD_REV1 OLD_REV2 ...'
-### Missing mtn automate branches
-_monotone_command_args['mtn automate cert']='REVISION-ID NAME VALUE'
-_monotone_command_args['mtn automate certs']='REV'
-_monotone_command_args['mtn automate checkout']='DIRECTORY'
-_monotone_command_options['mtn automate checkout']='--branch --move-conflicting-paths --no-move-conflicting-paths --revision -b -r'
-_monotone_command_args['mtn automate children']='REV'
-_monotone_command_args['mtn automate common_ancestors']='REV1 REV2 REV3 ...'
-_monotone_command_args['mtn automate content_diff']='FILE ...'
-_monotone_command_options['mtn automate content_diff']='--depth --exclude --reverse --revision --with-header --without-header -r'
-_monotone_command_args['mtn automate descendents']='REV1 REV2 REV3 ...'
-_monotone_command_args['mtn automate drop_attribute']='PATH KEY'
-_monotone_command_args['mtn automate drop_db_variables']='DOMAIN NAME'
-_monotone_command_args['mtn automate drop_public_key']='KEY_NAME_OR_HASH'
-_monotone_command_args['mtn automate erase_ancestors']='REV1 REV2 REV3 ...'
-_monotone_command_args['mtn automate file_merge']='LEFT_REVID LEFT_FILENAME RIGHT_REVID RIGHT_FILENAME'
-_monotone_command_args['mtn automate generate_key']='KEY_NAME PASSPHRASE'
-_monotone_command_options['mtn automate generate_key']='--force-duplicate-key'
-_monotone_command_args['mtn automate get_attributes']='PATH'
-### Missing mtn automate get_base_revision_id
-_monotone_command_args['mtn automate get_content_changed']='REV FILE'
-_monotone_command_args['mtn automate get_corresponding_path']='REV1 FILE REV2'
-_monotone_command_args['mtn automate get_current_revision']='PATHS ...'
-_monotone_command_options['mtn automate get_current_revision']='--depth --exclude'
-### Missing mtn automate get_current_revision_id
-_monotone_command_args['mtn automate get_db_variables']='DOMAIN'
-_monotone_command_args['mtn automate get_extended_manifest_of']='REVISION'
-_monotone_command_args['mtn automate get_file']='FILEID'
-_monotone_command_args['mtn automate get_file_of']='FILENAME'
-_monotone_command_options['mtn automate get_file_of']='--revision -r'
-_monotone_command_args['mtn automate get_file_size']='FILEID'
-_monotone_command_args['mtn automate get_manifest_of']='REVID'
-_monotone_command_args['mtn automate get_option']='OPTION'
-_monotone_command_args['mtn automate get_public_key']='KEY_NAME_OR_HASH'
-_monotone_command_args['mtn automate get_revision']='REVID'
-### Missing mtn automate get_workspace_root
-### Missing mtn automate graph
-_monotone_command_args['mtn automate heads']='BRANCH'
-_monotone_command_args['mtn automate identify']='PATH'
-### Missing mtn automate interface_version
-_monotone_command_args['mtn automate inventory']='PATH ...'
-_monotone_command_options['mtn automate inventory']='--corresponding-renames --depth --exclude --ignored --no-corresponding-renames --no-ignored --no-unchanged --no-unknown --unchanged --unknown'
-### Missing mtn automate keys
-### Missing mtn automate leaves
-_monotone_command_args['mtn automate log']='PATH ...'
-_monotone_command_options['mtn automate log']='--clear-from --clear-to --depth --exclude --from --last --merges --next --no-merges --to'
-_monotone_command_args['mtn automate lua']='LUA_FUNCTION ARG1 ARG2 ...'
-_monotone_command_args['mtn automate packet_for_fdata']='FILEID'
-_monotone_command_args['mtn automate packet_for_fdelta']='OLD_FILE NEW_FILE'
-_monotone_command_args['mtn automate packet_for_rdata']='REVID'
-_monotone_command_args['mtn automate packets_for_certs']='REVID'
-_monotone_command_args['mtn automate parents']='REV'
-_monotone_command_args['mtn automate pull']='ADDRESS:PORTNUMBER PATTERN ...'
-_monotone_command_options['mtn automate pull']='--dry-run --exclude --no-dry-run --no-set-default --set-default'
-_monotone_command_args['mtn automate push']='ADDRESS:PORTNUMBER PATTERN ...'
-_monotone_command_options['mtn automate push']='--dry-run --exclude --key-to-push --no-dry-run --no-set-default --set-default'
-_monotone_command_args['mtn automate put_file']='FILEID CONTENTS'
-_monotone_command_args['mtn automate put_public_key']='KEY-PACKET-DATA'
-_monotone_command_args['mtn automate put_revision']='REVISION-DATA'
-_monotone_command_args['mtn automate read_packets']='PACKET-DATA'
-_monotone_command_args['mtn automate remote']='COMMAND ARGS'
-_monotone_command_options['mtn automate remote']='--no-set-default --remote-stdio-host --set-default'
-_monotone_command_args['mtn automate remote_stdio']='ADDRESS:PORTNUMBER'
-_monotone_command_options['mtn automate remote_stdio']='--no-set-default --set-default'
-### Missing mtn automate roots
-_monotone_command_args['mtn automate select']='SELECTOR'
-_monotone_command_args['mtn automate set_attribute']='PATH KEY VALUE'
-_monotone_command_args['mtn automate set_db_variable']='DOMAIN NAME VALUE'
-_monotone_command_args['mtn automate show_conflicts']='LEFT_REVID RIGHT_REVID'
-_monotone_command_options['mtn automate show_conflicts']='--branch --ignore-suspend-certs --no-ignore-suspend-certs -b'
-_monotone_command_options['mtn automate stdio']='--automate-stdio-size'
-_monotone_command_args['mtn automate sync']='ADDRESS:PORTNUMBER PATTERN ...'
-_monotone_command_options['mtn automate sync']='--dry-run --exclude --key-to-push --no-dry-run --no-set-default --set-default'
-_monotone_command_args['mtn automate tags']='BRANCH_PATTERN'
-_monotone_command_args['mtn automate toposort']='REV1 REV2 REV3 ...'
-_monotone_command_options['mtn automate update']='--branch --move-conflicting-paths --no-move-conflicting-paths --revision -b -r'
-_monotone_commands['mtn bisect']='bad good reset skip status update'
-_monotone_command_options['mtn bisect bad']='--move-conflicting-paths --no-move-conflicting-paths --revision -r'
-_monotone_command_options['mtn bisect good']='--move-conflicting-paths --no-move-conflicting-paths --revision -r'
-### Missing mtn bisect reset
-_monotone_command_options['mtn bisect skip']='--move-conflicting-paths --no-move-conflicting-paths --revision -r'
-### Missing mtn bisect status
-_monotone_command_options['mtn bisect update']='--move-conflicting-paths --no-move-conflicting-paths'
-_monotone_command_args['mtn cat']='FILENAME'
-_monotone_command_options['mtn cat']='--revision -r'
-_monotone_command_args['mtn cert']='SELECTOR CERTNAME CERTVAL'
-_monotone_command_args['mtn checkout']='DIRECTORY'
-_monotone_command_args['mtn ci']='PATH ...'
-### Missing mtn cleanup_workspace_list
-_monotone_command_args['mtn clone']='HOST:PORTNUMBER BRANCH DIRECTORY'
-_monotone_command_options['mtn clone']='--branch --revision -b -r'
-_monotone_command_args['mtn co']='DIRECTORY'
-_monotone_command_options['mtn co']='--branch --move-conflicting-paths --no-move-conflicting-paths --revision -b -r'
-_monotone_command_args['mtn comment']='REVISION COMMENT'
-_monotone_command_args['mtn commit']='PATH ...'
-_monotone_command_options['mtn commit']='--author --branch --date --depth --exclude --message --message-file -b -m'
-_monotone_command_args['mtn complete']='(revision|file|key) PARTIAL-ID'
-_monotone_commands['mtn conflicts']='clean resolve_first resolve_first_left resolve_first_right show_first show_remaining store'
-### Missing mtn conflicts clean
-_monotone_command_args['mtn conflicts resolve_first']='RESOLUTION'
-_monotone_command_options['mtn conflicts resolve_first']='--conflicts-file'
-_monotone_command_args['mtn conflicts resolve_first_left']='RESOLUTION'
-_monotone_command_options['mtn conflicts resolve_first_left']='--conflicts-file'
-_monotone_command_args['mtn conflicts resolve_first_right']='RESOLUTION'
-_monotone_command_options['mtn conflicts resolve_first_right']='--conflicts-file'
-_monotone_command_options['mtn conflicts show_first']='--conflicts-file'
-_monotone_command_options['mtn conflicts show_remaining']='--conflicts-file'
-_monotone_command_args['mtn conflicts store']='LEFT_REVID RIGHT_REVID'
-_monotone_command_options['mtn conflicts store']='--branch --conflicts-file -b'
-_monotone_command_args['mtn cvs_import']='CVSROOT'
-_monotone_command_options['mtn cvs_import']='--branch -b'
-_monotone_commands['mtn db']='changesetify check dump execute fix_certs info init load migrate regenerate_caches rosterify set_epoch version'
-### Missing mtn db changesetify
-### Missing mtn db check
-### Missing mtn db dump
-### Missing mtn db execute
-_monotone_command_options['mtn db fix_certs']='--drop-bad-certs'
-_monotone_command_options['mtn db info']='--concise --full'
-### Missing mtn db init
-### Missing mtn db load
-### Missing mtn db migrate
-### Missing mtn db regenerate_caches
-_monotone_command_options['mtn db rosterify']='--drop-attr'
-_monotone_command_args['mtn db set_epoch']='BRANCH EPOCH'
-### Missing mtn db version
-_monotone_command_args['mtn di']='PATH ...'
-_monotone_command_args['mtn diff']='PATH ...'
-_monotone_command_options['mtn diff']='--context --depth --diff-args --exclude --external --no-show-encloser --reverse --revision --show-encloser --unified --with-header --without-header -r'
-_monotone_command_args['mtn disapprove']='PARENT-REVISION CHILD-REVISION'
-_monotone_command_options['mtn disapprove']='--author --branch --date --message --message-file --no-update --update -b -m'
-_monotone_command_args['mtn drop']='PATH ...'
-_monotone_command_args['mtn dropkey']='KEY_NAME_OR_HASH'
-_monotone_command_args['mtn explicit_merge']='LEFT-REVISION RIGHT-REVISION DEST-BRANCH'
-_monotone_command_options['mtn explicit_merge']='--author --date --message --message-file --no-resolve-conflicts --no-update --resolve-conflicts --resolve-conflicts-file --update -m'
-_monotone_command_args['mtn fdiff']='SRCNAME DESTNAME SRCID DESTID'
-_monotone_command_options['mtn fdiff']='--context --diff-args --external --no-show-encloser --reverse --show-encloser --unified --with-header --without-header'
-### Missing mtn fload
-_monotone_command_args['mtn fmerge']='PARENT_FILEID LEFT_FILEID RIGHT_FILEID'
-_monotone_command_args['mtn genkey']='KEY_NAME'
-_monotone_command_options['mtn genkey']='--force-duplicate-key'
-_monotone_command_args['mtn get_roster']='REVID'
-_monotone_command_options['mtn git_export']='--authors-file --branches-file --export-marks --import-marks --log-certs --log-revids --no-log-certs --no-log-revids --refs --use-one-changelog'
-_monotone_command_options['mtn heads']='--branch -b'
-_monotone_command_args['mtn help']='command ARGS ...'
-_monotone_command_options['mtn help']='--hidden --no-hidden'
-_monotone_command_args['mtn identify']='PATH'
-_monotone_command_args['mtn import']='DIRECTORY'
-_monotone_command_options['mtn import']='--author --branch --date --dry-run --exclude --message --message-file --no-dry-run --no-respect-ignore --respect-ignore --revision -b -m -r'
-_monotone_commands['mtn list']='branches certs changed databases dbs duplicates epochs ignored keys known missing tags unknown vars workspaces'
-_monotone_command_args['mtn list branches']='PATTERN'
-_monotone_command_options['mtn list branches']='--exclude'
-_monotone_command_args['mtn list certs']='REVID'
-_monotone_command_args['mtn list changed']='PATH ...'
-_monotone_command_options['mtn list changed']='--depth --exclude'
-### Missing mtn list databases
-### Missing mtn list dbs
-_monotone_command_options['mtn list duplicates']='--revision -r'
-_monotone_command_args['mtn list epochs']='BRANCH ...'
-_monotone_command_args['mtn list ignored']='PATH'
-_monotone_command_options['mtn list ignored']='--depth --exclude'
-_monotone_command_args['mtn list keys']='PATTERN'
-_monotone_command_options['mtn list known']='--depth --exclude'
-_monotone_command_options['mtn list missing']='--depth --exclude'
-_monotone_command_args['mtn list tags']='PATTERN'
-_monotone_command_options['mtn list tags']='--exclude'
-_monotone_command_args['mtn list unknown']='PATH'
-_monotone_command_options['mtn list unknown']='--depth --exclude'
-_monotone_command_args['mtn list vars']='DOMAIN'
-### Missing mtn list workspaces
-_monotone_commands['mtn local']='kill_certs kill_revision'
-_monotone_command_args['mtn local kill_certs']='SELECTOR CERTNAME CERTVAL'
-_monotone_command_args['mtn local kill_revision']='REVID'
-_monotone_command_args['mtn log']='PATH ...'
-_monotone_command_options['mtn log']='--brief --clear-from --clear-to --depth --diffs --exclude --files --from --graph --last --merges --next --no-brief --no-diffs --no-files --no-graph --no-merges --revision --to -r'
-_monotone_command_options['mtn manpage']='--formatted --hidden --no-hidden --plain'
-_monotone_command_options['mtn merge']='--author --branch --date --message --message-file --no-resolve-conflicts --no-update --resolve-conflicts --resolve-conflicts-file --update -b -m'
-_monotone_command_args['mtn merge_into_dir']='SOURCE-BRANCH DEST-BRANCH DIR'
-_monotone_command_options['mtn merge_into_dir']='--author --date --message --message-file --no-resolve-conflicts --no-update --resolve-conflicts --resolve-conflicts-file --update -m'
-_monotone_command_args['mtn merge_into_workspace']='OTHER-REVISION'
-_monotone_command_options['mtn merge_into_workspace']='--move-conflicting-paths --no-move-conflicting-paths'
-_monotone_command_args['mtn migrate_workspace']='DIRECTORY'
-_monotone_command_args['mtn mkdir']='DIRECTORY ...'
-_monotone_command_options['mtn mkdir']='--no-respect-ignore --respect-ignore'
-_monotone_command_args['mtn mv']='SRC1 SRC2 ... DEST_DIR'
-_monotone_command_args['mtn passphrase']='KEY_NAME_OR_HASH'
-_monotone_command_args['mtn pivot_root']='NEW_ROOT PUT_OLD'
-_monotone_command_options['mtn pivot_root']='--bookkeep-only --move-conflicting-paths --no-move-conflicting-paths'
-_monotone_command_args['mtn pluck']='PATH ...'
-_monotone_command_options['mtn pluck']='--depth --exclude --move-conflicting-paths --no-move-conflicting-paths --revision -r'
-_monotone_command_args['mtn privkey']='KEY_NAME_OR_HASH'
-_monotone_command_args['mtn propagate']='SOURCE-BRANCH DEST-BRANCH'
-_monotone_command_options['mtn propagate']='--author --date --message --message-file --no-resolve-conflicts --resolve-conflicts --resolve-conflicts-file -m'
-_monotone_command_args['mtn pubkey']='KEY_NAME_OR_HASH'
-_monotone_command_args['mtn pull']='ADDRESS:PORTNUMBER PATTERN ...'
-_monotone_command_options['mtn pull']='--dry-run --exclude --no-dry-run --no-set-default --no-update --set-default --update'
-_monotone_command_args['mtn push']='ADDRESS:PORTNUMBER PATTERN ...'
-_monotone_command_options['mtn push']='--dry-run --exclude --key-to-push --no-dry-run --no-set-default --set-default'
-_monotone_command_args['mtn rcs_import']='RCSFILE ...'
-_monotone_command_options['mtn rcs_import']='--branch -b'
-_monotone_command_args['mtn read']='FILE1 FILE2 ...'
-### Missing mtn refresh_inodeprints
-_monotone_command_args['mtn register_workspace']='WORKSPACE_PATH'
-_monotone_command_args['mtn rename']='SRC1 SRC2 ... DEST_DIR'
-_monotone_command_options['mtn rename']='--bookkeep-only'
-_monotone_command_args['mtn revert']='PATH ...'
-_monotone_command_options['mtn revert']='--depth --exclude --missing'
-_monotone_command_args['mtn rm']='PATH ...'
-_monotone_command_options['mtn rm']='--bookkeep-only --missing --no-recursive --recursive -R'
-_monotone_command_options['mtn serve']='--bind --no-pid-file --pid-file'
-_monotone_command_args['mtn set']='DOMAIN NAME VALUE'
-_monotone_command_args['mtn setup']='DIRECTORY'
-_monotone_command_options['mtn setup']='--branch -b'
-_monotone_command_args['mtn show_conflicts']='REV REV'
-### Missing mtn ssh_agent_add
-_monotone_command_args['mtn ssh_agent_export']='FILENAME'
-_monotone_command_args['mtn status']='PATH ...'
-_monotone_command_options['mtn status']='--depth --exclude'
-_monotone_command_args['mtn suspend']='REVISION'
-_monotone_command_options['mtn suspend']='--branch --no-update --update -b'
-_monotone_command_args['mtn sync']='ADDRESS:PORTNUMBER PATTERN ...'
-_monotone_command_options['mtn sync']='--dry-run --exclude --key-to-push --no-dry-run --no-set-default --no-update --set-default --update'
-_monotone_command_args['mtn tag']='REVISION TAGNAME'
-_monotone_command_args['mtn testresult']='REV (pass|fail|true|false|yes|no|1|0)'
-_monotone_command_args['mtn trusted']='REVISION NAME VALUE SIGNER1 SIGNER2 ...'
-_monotone_command_args['mtn undrop']='PATH ...'
-_monotone_command_args['mtn unregister_workspace']='WORKSPACE_PATH'
-_monotone_command_args['mtn unset']='DOMAIN NAME'
-_monotone_command_options['mtn update']='--branch --move-conflicting-paths --no-move-conflicting-paths --revision -b -r'
-_monotone_command_options['mtn version']='--concise --full'
address@hidden@
 # END ------------------------------------------------------------------------
     
 
============================================================
--- contrib/monotone_gen_bash_completion_table.pl	65876d0a667e0282a74d20f26a5b26677b25df81
+++ extra/shell/monotone_gen_bash_completion_table.pl	543ae9c64ec5db10f3bdd05090e3d2a5cdb0273b
@@ -49,8 +49,8 @@ while (<MANPAGE>) {
 
 	my $parent_command = "";
 	for my $commandlet (split(m|\s+|,$current_command)) {
-	    print STDERR "DEBUG[$current_command]: parent command = $parent_command\n";
-	    print STDERR "DEBUG[$current_command]: commandlet = $commandlet\n";
+#	    print STDERR "DEBUG[$current_command]: parent command = $parent_command\n";
+#	    print STDERR "DEBUG[$current_command]: commandlet = $commandlet\n";
 	    if ($parent_command eq "") {
 		$parent_command = $commandlet;
 	    } else {
@@ -66,8 +66,8 @@ while (<MANPAGE>) {
 
 	my $parent_command = "";
 	for my $commandlet (split(m|\s+|,$current_command)) {
-	    print STDERR "DEBUG[$current_command]: parent command = $parent_command\n";
-	    print STDERR "DEBUG[$current_command]: commandlet = $commandlet\n";
+#	    print STDERR "DEBUG[$current_command]: parent command = $parent_command\n";
+#	    print STDERR "DEBUG[$current_command]: commandlet = $commandlet\n";
 	    if ($parent_command eq "") {
 		$parent_command = $commandlet;
 	    } else {
@@ -80,7 +80,7 @@ while (<MANPAGE>) {
     }
 }
 
-print STDERR "DEBUG: command keys: \n  ",join("\n  ", sort keys %commands),"\n";
+#print STDERR "DEBUG: command keys: \n  ",join("\n  ", sort keys %commands),"\n";
 
 print "declare -a _monotone_options_noarg\n";
 print "_monotone_options_noarg=(\n    "
@@ -133,7 +133,7 @@ foreach my $key (sort keys %commands) {
 print "declare -A _monotone_commands\n";
 
 foreach my $key (sort keys %commands) {
-    print STDERR "DEBUG: key = $key\n";
+#    print STDERR "DEBUG: key = $key\n";
     print "_monotone_commands['$key']='"
 	,join(" ",sort keys %{$commands{$key}})
 	,"'\n" if defined %{$commands{$key}};
============================================================
--- /dev/null	
+++ test/extra/bash_completion/__driver__.lua	8fd46d0044012ef2a1686aa2ffe4c5729071198c
@@ -0,0 +1,61 @@
+mtn_setup()
+
+local tests = {
+   ["complete_mtn_-"] = {
+      ["prepare"] = 
+	 function ()
+	 end,
+      ["cleanup"] =
+	 function ()
+	 end
+   },
+   ["complete_propagate"] = {
+      ["prepare"] = 
+	 function ()
+	    addfile("prop-test", "foo")
+	    commit("prop-br1")
+	    writefile("prop-test", "bar")
+	    commit("prop-bra2")
+	 end,
+      ["cleanup"] =
+	 function ()
+	 end
+   },
+   ["complete_commit"] = {
+      ["prepare"] = 
+	 function ()
+	    addfile("commit-test1", "foo")
+	    addfile("commit-test2", "bar")
+	 end,
+      ["cleanup"] =
+	 function ()
+	 end
+   }
+}
+
+function expect(test)
+   if monotone_path == nil then
+      monotone_path = os.getenv("mtn")
+      if monotone_path == nil then
+	 err("'mtn' environment variable not set")
+      end
+   end
+   check(get(test..".exp"), 0, false, false)
+   if existsonpath("expect") then
+      check({"expect",
+	     "-c", "set mtn \""..cmd_as_str(mtn()).."\"",
+	     "-c", "set srcdir \""..srcdir.."\"",
+	     "-c", "source library.exp",
+	     "-f", test..".exp"}, 0, true, false)
+      check(grep("<<success>>", "stdout"), 0, false, false)
+   else
+      check(false)
+   end
+end
+
+get("library.exp")
+for test,fns in pairs(tests) do
+   fns.prepare()
+   expect(test)
+   fns.cleanup()
+end
============================================================
--- /dev/null	
+++ test/extra/bash_completion/complete_commit.exp	439e4abfd8e54e82a86bc7d131fc3f4d2d22eb7b
@@ -0,0 +1,26 @@
+# This test checks that monotone.bash_completion2 can handle arguments that
+# are specified as 'PATH ...'
+
+set CTRLC \003
+set timeout 2
+
+send "$mtn commit -m 'foobar' \t\t"
+expect "mtn commit"
+expect {
+    -ex "commit-test1" {
+	expect {
+	    -ex "commit-test2" {
+	    }
+	}
+    }
+    timeout { failure; exit }
+}
+
+send "commit-test1 commit-test\t\t"
+expect {
+    -ex "commit-test2" {
+	success
+    }
+    timeout { failure; exit }
+}
+failure
============================================================
--- /dev/null	
+++ test/extra/bash_completion/complete_mtn_-.exp	5518c9ce3d09dafac3f3b9e9f8493811f71846c9
@@ -0,0 +1,13 @@
+# Check that something is compled with 'mtn -'
+
+send "$mtn -\t"
+#expect -ex "mtn -"
+send "\t"
+expect {
+    -timeout 2
+    -- "--no-workspace" {
+	success
+	exit
+    }
+}
+failure
============================================================
--- /dev/null	
+++ test/extra/bash_completion/complete_propagate.exp	409ea6ac7a02318153e0aaf92f28232e8de2465f
@@ -0,0 +1,26 @@
+set CTRLC \003
+set timeout 2
+
+send "$mtn propagate \t\t"
+expect "mtn propagate"
+expect {
+    -ex "prop-br1" {
+	expect {
+	    -ex "prop-bra2" {
+	    }
+	}
+    }
+    timeout { failure; exit }
+}
+
+send "$CTRLC\n\n"
+
+# One \t is enough for the second branch name to expand
+send "$mtn propagate prop-br1 prop-bra\t"
+expect {
+    -ex "prop-bra2" {
+	success
+    }
+    timeout { failure; exit }
+}
+failure
============================================================
--- /dev/null	
+++ test/extra/bash_completion/library.exp	d77b4b981f9f7c170f039c090fabfc8ab3b2d416
@@ -0,0 +1,28 @@
+# Functions and starter for the bash completion tests
+
+proc success {} {
+    send_user "\n<<success>>\n"
+}
+
+proc failure {} {
+    send_user "\n<<failure>>\n"
+}
+
+send_user "mtn = $mtn\n"
+send_user "srcdir = $srcdir\n"
+send_user "PATH = $env(PATH)\n"
+spawn "bash" "-l"
+send "export PS1='@ '\n"
+send "export PS2='_@ '\n"
+send "pwd\n"
+# For some reason, it seems bash doesn't load the bash completion package,
+# even though started with -l...
+send ". /etc/bash_completion\n"
+expect {
+    -timeout 1
+    "bash: /etc/bash_completion: " { failure; exit }
+}
+send ". $srcdir/../extra/shell/monotone.bash_completion\n"
+# Wait for the last line to be echoed
+expect "bash_completion2"
+#stty rows 512

reply via email to

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