Commits

Steve Borho  committed 7f044c2

contrib: prune old hgtk files

  • Participants
  • Parent commits 59ebea4

Comments (0)

Files changed (5)

File contrib/_hgtk

-#compdef hgtk
-
-# Zsh completion script for hgtk.
-# copy it into your zsh function path (/usr/share/zsh/site-functions)
-#
-# Copyright (C) 2009-2010 Steve Borho
-#
-# This is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-
-emulate -LR zsh
-setopt extendedglob
-
-local curcontext="$curcontext" state line
-typeset -A _hg_cmd_globals
-
-_hgtk() {
-  local cmd _hg_root
-  integer i=2
-  _hg_cmd_globals=()
-
-  while (( i < $#words ))
-  do
-    case "$words[$i]" in
-      -R|--repository)
-        eval _hg_root="$words[$i+1]"
-        _hg_cmd_globals+=("$words[$i]" "$_hg_root")
-        (( i += 2 ))
-        continue
-      ;;
-      -R*)
-        _hg_cmd_globals+="$words[$i]"
-        eval _hg_root="${words[$i]#-R}"
-       (( i++ ))
-       continue
-      ;;
-      --cwd|--config)
-        # pass along arguments to hg completer
-        _hg_cmd_globals+=("$words[$i]" "$words[$i+1]")
-        (( i += 2 ))
-        continue
-      ;;
-      -*)
-        # skip option
-        (( i++ ))
-        continue
-      ;;
-    esac
-    if [[ -z "$cmd" ]]
-    then
-      cmd="$words[$i]"
-      words[$i]=()
-      (( CURRENT-- ))
-    fi
-    (( i++ ))
-  done
-
-  if [[ -z "$cmd" ]]
-  then
-    _arguments -s -w : $_hgtk_global_opts \
-    ':hgtk command:_hgtk_commands'
-    return
-  fi
-
-  # resolve abbreviations and aliases
-  if ! (( $+functions[_hgtk_cmd_${cmd}] ))
-  then
-    local cmdexp
-    (( $#_hgtk_cmd_list )) || _hgtk_get_commands
-
-    cmdexp=$_hgtk_cmd_list[(r)${cmd}*]
-    if [[ $cmdexp == $_hgtk_cmd_list[(R)${cmd}*] ]]
-    then
-      # might be nice to rewrite the command line with the expansion
-      cmd="$cmdexp"
-    fi
-    if [[ -n $_hgtk_alias_list[$cmd] ]]
-    then
-      cmd=$_hgtk_alias_list[$cmd]
-    fi
-  fi
-
-  curcontext="${curcontext%:*:*}:hgtk-${cmd}:"
-
-  zstyle -s ":completion:$curcontext:" cache-policy update_policy
-
-  if [[ -z "$update_policy" ]]
-  then
-    zstyle ":completion:$curcontext:" cache-policy _hgtk_cache_policy
-  fi
-
-  if (( $+functions[_hgtk_cmd_${cmd}] ))
-  then
-    _hgtk_cmd_${cmd}
-  else
-    # complete unknown commands normally
-    _arguments -s -w : $_hgtk_global_opts \
-      '*:files:_hg_files'
-  fi
-}
-
-_hgtk_cache_policy() {
-  typeset -a old
-
-  # cache for a minute
-  old=( "$1"(mm+10) )
-  (( $#old )) && return 0
-
-  return 1
-}
-
-_hgtk_get_commands() {
-  typeset -ga _hgtk_cmd_list
-  typeset -gA _hgtk_alias_list
-  local hline cmd cmdalias
-
-  _call_program hgtk hgtk debugcomplete -v 2>/dev/null | while read -A hline
-  do
-    cmd=$hline[1]
-    _hgtk_cmd_list+=($cmd)
-
-    for cmdalias in $hline[2,-1]
-    do
-      _hgtk_cmd_list+=($cmdalias)
-      _hgtk_alias_list+=($cmdalias $cmd)
-    done
-  done
-}
-
-_hgtk_commands() {
-  (( $#_hgtk_cmd_list )) || _hgtk_get_commands
-  _describe -t commands 'hgtk command' _hgtk_cmd_list
-}
-
-_hg_revrange() {
-  compset -P 1 '*:'
-  _hg_tags "$@"
-}
-
-_hg_tags() {
-  typeset -a tags
-  local tag rev
-
-  _hg_cmd tags 2> /dev/null | while read tag
-  do
-    tags+=(${tag/ #    [0-9]#:*})
-  done
-  (( $#tags )) && _describe -t tags 'tags' tags
-}
-
-_hg_files() {
-  if [[ -n "$_hg_root" ]]
-  then
-    [[ -d "$_hg_root/.hg" ]] || return
-    case "$_hg_root" in
-      /*)
-        _files -W $_hg_root
-      ;;
-      *)
-        _files -W $PWD/$_hg_root
-      ;;
-    esac
-  else
-    _files
-  fi
-}
-
-_hg_status() {
-  [[ -d $PREFIX ]] || PREFIX=$PREFIX:h
-  status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX 2>/dev/null)"})
-}
-
-_hg_unknown() {
-  typeset -a status_files
-  _hg_status u
-  _wanted files expl 'unknown files' _multi_parts / status_files
-}
-
-_hg_missing() {
-  typeset -a status_files
-  _hg_status d
-  _wanted files expl 'missing files' _multi_parts / status_files
-}
-
-_hg_modified() {
-  typeset -a status_files
-  _hg_status m
-  _wanted files expl 'modified files' _multi_parts / status_files
-}
-
-_hg_resolve() {
-  local rstate rpah
-
-  [[ -d $PREFIX ]] || PREFIX=$PREFIX:h
-
-  _hg_cmd resolve -l ./$PREFIX 2> /dev/null | while read rstate rpath
-  do
-    [[ $rstate == 'R' ]] && resolved_files+=($rpath)
-    [[ $rstate == 'U' ]] && unresolved_files+=($rpath)
-  done
-}
-
-_hg_resolved() {
-  typeset -a resolved_files unresolved_files
-  _hg_resolve
-  _wanted files expl 'resolved files' _multi_parts / resolved_files
-}
-
-_hg_unresolved() {
-  typeset -a resolved_files unresolved_files
-  _hg_resolve
-  _wanted files expl 'unresolved files' _multi_parts / unresolved_files
-}
-
-_hg_config() {
-    typeset -a items
-    items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*})
-    (( $#items )) && _describe -t config 'config item' items
-}
-
-_hg_addremove() {
-  _alternative 'files:unknown files:_hg_unknown' \
-    'files:missing files:_hg_missing'
-}
-
-_hg_ssh_urls() {
-  if [[ -prefix */ ]]
-  then
-    if zstyle -T ":completion:${curcontext}:files" remote-access
-    then
-      local host=${PREFIX%%/*}
-      typeset -a remdirs
-      compset -p $(( $#host + 1 ))
-      local rempath=${(M)PREFIX##*/}
-      local cacheid="hg:${host}-${rempath//\//_}"
-      cacheid=${cacheid%[-_]}
-      compset -P '*/'
-      if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid"
-      then
-        remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}" 2> /dev/null)"}##*/}%/})
-        _store_cache "$cacheid" remdirs
-      fi
-      _describe -t directories 'remote directory' remdirs -S/
-    else
-      _message 'remote directory'
-    fi
-  else
-    if compset -P '*@'
-    then
-      _hosts -S/
-    else
-      _alternative 'hosts:remote host name:_hosts -S/' \
-        'users:user:_users -S@'
-    fi
-  fi
-}
-
-_hg_urls() {
-  if compset -P bundle://
-  then
-    _files
-  elif compset -P ssh://
-  then
-    _hg_ssh_urls
-  elif [[ -prefix *: ]]
-  then
-    _urls
-  else
-    local expl
-    compset -S '[^:]*'
-    _wanted url-schemas expl 'URL schema' compadd -S '' - \
-      http:// https:// ssh:// bundle://
-  fi
-}
-
-_hg_paths() {
-  typeset -a paths pnames
-  _hg_cmd paths 2> /dev/null | while read -A pnames
-  do
-    paths+=($pnames[1])
-  done
-  (( $#paths )) && _describe -t path-aliases 'repository alias' paths
-}
-
-_hg_remote() {
-  _alternative 'path-aliases:repository alias:_hg_paths' \
-    'directories:directory:_files -/' \
-    'urls:URL:_hg_urls'
-}
-
-_hg_clone_dest() {
-  _alternative 'directories:directory:_files -/' \
-    'urls:URL:_hg_urls'
-}
-
-# Common options
-_hgtk_global_opts=(
-    '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/'
-    '(--verbose -v)'{-v,--verbose}'[enable additional output]'
-    '(--quiet -q)'{-q,--quiet}'[suppress output]'
-    '(--help -h)'{-h,--help}'[display help and exit]'
-    '--debugger[start debugger]'
-)
-
-_hg_cmd() {
-  _call_program hg hg "$_hg_cmd_globals[@]" "$@"
-}
-
-_hgtk_cmd_add() {
-  _arguments -s -w : $_hgtk_global_opts \
-  '*:unknown files:_hg_unknown'
-}
-
-_hgtk_cmd_annotate() {
-  _arguments -s -w : $_hgtk_global_opts \
-  '*:files:_hg_files'
-}
-
-_hgtk_cmd_clone() {
-  _arguments -s -w : $_hgtk_global_opts \
-  ':source repository:_hg_remote' \
-  ':destination:_hg_clone_dest'
-}
-
-_hgtk_cmd_commit() {
-  _arguments -s -w : $_hgtk_global_opts \
-  '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
-  '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
-  '*:file:_hg_files'
-}
-
-_hgtk_cmd_vdiff() {
-  typeset -A opt_args
-  _arguments -s -w : $_hgtk_global_opts \
-  '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \
-  '*:file:->diff_files'
-
-  if [[ $state == 'diff_files' ]]
-  then
-    if [[ -n $opt_args[-r] ]]
-    then
-      _hg_files
-    else
-      _hg_modified
-    fi
-  fi
-}
-
-_hgtk_cmd_grep() {
-  _arguments -s -w : $_hgtk_global_opts \
-  '*:files:_hg_files'
-}
-
-_hgtk_cmd_help() {
-  _arguments -s -w : $_hgtk_global_opts \
-  '*:hgtk command:_hgtk_commands'
-}
-
-_hgtk_cmd_init() {
-  _arguments -s -w : $_hgtk_global_opts \
-  ':dir:_files -/'
-}
-
-_hgtk_cmd_log() {
-  _arguments -s -w : $_hgtk_global_opts \
-  '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \
-  '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \
-  '*:files:_hg_files'
-}
-
-_hgtk_cmd_pull() {
-  _arguments -s -w : $_hgtk_global_opts 
-}
-
-_hgtk_cmd_push() {
-  _arguments -s -w : $_hgtk_global_opts 
-}
-
-_hgtk_cmd_rename() {
-  _arguments -s -w : $_hgtk_global_opts \
-  '*:file:_hg_files'
-}
-
-_hgtk_cmd_serve() {
-  _arguments -s -w : $_hgtk_global_opts 
-}
-
-_hgtk_cmd_status() {
-  _arguments -s -w : $_hgtk_global_opts \
-  '--rev[show difference from revision]:revision:_hg_tags' \
-  '*:files:_files'
-}
-
-_hgtk_cmd_update() {
-  _arguments -s -w : $_hgtk_global_opts \
-  '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \
-  ':revision:_hg_tags'
-}
-
-_hgtk "$@"

File contrib/bash_completion

-#
-#      hgtk
-#
-#      contrib/bash_completion
-#
-#      Copyright 2009 Andreas Tscharner <andy@vis.ethz.ch>
-#
-#      This program is free software; you can redistribute it and/or modify
-#      it under the terms of the GNU General Public License version 2
-#      as published by the Free Software Foundation.
-#
-#      This program is distributed in the hope that it will be useful,
-#      but WITHOUT ANY WARRANTY; without even the implied warranty of
-#      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#      GNU General Public License for more details.
-#
-#      You should have received a copy of the GNU General Public License
-#      along with this program; if not, write to the Free Software
-#      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-#      MA 02110-1301, USA.
-
-_hgtk()
-{
-	local cur prev opts cmds
-
-	COMPREPLY=()
-	cur="${COMP_WORDS[COMP_CWORD]}"
-	prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-	cmds="about add annotate archive blame checkout clone commit datamine diff email explorer filter forget grep guess hgignore history ignore init incoming log merge outgoing pull push recovery remove rename repoconfig revert rollback serve shelve status strip synch unshelve update userconfig vdiff verify version"
-
-	opts="-R --repository -v --verbose -q --quiet -h --help --debugger --nofork --fork --listfile"
-
-	if [[ ${cur} == -* ]] ; then
-		COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
-	else
-		COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) )
-	fi
-	return 0
-}
-complete -F _hgtk hgtk

File contrib/hgtk.cmd

-::
-:: Win32 batch file for running the TortoiseHg hgtk script.
-:: Copy this file into the install directory and rename hgtk.exe
-:: to e.g. hgtk-hidden.exe
-::
-
-@echo off
-setlocal
-
-:: Uncomment the line below and modify accoringly
-::set hgtkpath="C:\path\to\hgtk"
-if not defined hgtkpath goto :notfound
-python %hgtkpath% %*
-goto end
-
-:notfound
-echo hgtk: Please configure hgtkpath in %~f0
-:end

File contrib/taskbar.cmd

-@echo off
-@rem Copy into or run from repo root
-python thgtaskbar.py

File contrib/tortoisehg_hgtk.desktop

-[Desktop Entry]
-Type=Service
-X-KDE-ServiceTypes=KonqPopupMenu/Plugin,inode/directory,all/allfiles
-X-KDE-Submenu=Mercurial (hgtk)
-Actions=Log;Status;Shelve;Diff;Commit;Add;Revert;Rename;Forget;Remove;Update;Search;Synch;Serve;Clone;Init;Ignore;Guess;Recovery;Repoconfig;Userconfig;Aboutthg;
-
-# TODO: X-KDE-GetActionMenu support
-
-[Desktop Action Log]
-Name=Repository Explorer
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/repobrowse.svg
-Exec=hgtk -R "$(hg root --cwd %f)" --nofork log
-
-[Desktop Action Status]
-Name=View File Status
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/status.svg
-Exec=hgtk -R "$(hg root --cwd %f)" --nofork status
-
-[Desktop Action Shelve]
-Name=Shelve Changes
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/shelve.svg
-Exec=hgtk -R "$(hg root --cwd %f)" --nofork shelve
-
-[Desktop Action Diff]
-Name=Visual Diff
-Icon=/usr/share/pixmaps/tortoisehg/icons/menudiff.ico
-Exec=hgtk -R "$(hg root --cwd %f)" --nofork vdiff
-
-[Desktop Action Commit]
-Name=Commit
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/commit.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork commit
-
-[Desktop Action Add]
-Name=Add Files...
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/add.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork add %f
-
-[Desktop Action Revert]
-Name=Revert Files...
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/revert.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork revert %f
-
-[Desktop Action Rename]
-Name=Rename Files...
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/recovery.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork rename %f
-
-[Desktop Action Forget]
-Name=Forget Files...
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/remove.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork forget %f
-
-[Desktop Action Remove]
-Name=Remove Files...
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/remove.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork remove %f
-
-[Desktop Action Update]
-Name=Update...
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/checkout.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork update
-
-[Desktop Action Search]
-Name=Search History
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/repobrowse.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork datamine
-
-[Desktop Action Synch]
-Name=Synchronize
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/sync.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork synch
-
-[Desktop Action Serve]
-Name=Web Server
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/proxy.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork serve
-
-[Desktop Action Clone]
-Name=Clone...
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/clone.svg
-Exec=/usr/bin/hgtk --nofork clone %f
-
-[Desktop Action Init]
-Name=Create Repository Here
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/init.svg
-Exec=/usr/bin/hgtk --nofork init %f
-
-[Desktop Action Ignore]
-Name=Edit Ignore Filter
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/ignore.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork hgignore %f
-
-[Desktop Action Guess]
-Name=Guess Renames
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/detect_rename.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork guess %f
-
-[Desktop Action Recovery]
-Name=Recovery...
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/recovery.svg
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork recovery %f
-
-[Desktop Action Repoconfig]
-Name=Repository settings
-Icon=/usr/share/pixmaps/tortoisehg/icons/settings_repo.ico
-Exec=/usr/bin/hgtk -R "$(hg root --cwd %f)" --nofork repoconfig
-
-[Desktop Action Userconfig]
-Name=Global Settings
-Icon=/usr/share/pixmaps/tortoisehg/icons/settings_user.ico
-Exec=/usr/bin/hgtk --nofork userconfig
-
-[Desktop Action Aboutthg]
-Name=About TortoiseHg
-Icon=/usr/share/pixmaps/tortoisehg/icons/svg/thg_logo.svg
-Exec=/usr/bin/hgtk --nofork about