Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

zsh: prune unsupported commands, some arguments

Changeset 281b663a5fc3

Parent 3bf35bb9c157

by Steve Borho

Changes to one file · Browse files at 281b663a5fc3 Showing diff from parent 3bf35bb9c157 Diff from another changeset...

Change 1 of 15 Show Entire File contrib/​_hgtk Stacked
 
1
2
3
4
5
 
 
6
7
8
 
9
10
11
 
133
134
135
136
 
137
138
139
 
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
 
326
327
328
329
330
331
332
333
334
 
347
348
349
350
 
351
352
353
354
355
356
357
358
359
360
361
362
 
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
 
423
424
425
426
427
428
429
430
431
432
433
 
434
435
436
 
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
 
500
501
502
 
515
516
517
518
519
520
521
522
523
524
525
526
527
528
 
538
539
540
541
542
543
544
545
546
547
548
 
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
 
587
588
589
590
 
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
 
618
619
620
 
647
648
649
650
651
652
653
654
655
656
657
658
 
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
 
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
 
1
2
 
 
 
3
4
5
 
 
6
7
8
9
 
131
132
133
 
134
135
136
137
 
298
299
300
 
 
301
 
302
303
 
304
 
 
 
 
 
 
 
305
306
307
 
313
314
315
 
 
 
316
317
318
 
331
332
333
 
334
335
336
337
 
 
 
 
 
 
338
339
340
 
347
348
349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
351
352
 
366
367
368
 
 
 
 
 
 
 
 
369
370
371
372
 
415
416
417
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
419
420
421
 
434
435
436
 
 
 
 
 
 
 
 
437
438
439
 
449
450
451
 
 
 
 
 
452
453
454
 
459
460
461
 
 
 
 
 
 
 
 
 
 
 
462
463
464
 
482
483
484
 
485
486
487
488
489
490
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
492
493
494
 
495
496
497
498
 
525
526
527
 
 
 
 
 
 
528
529
530
 
542
543
544
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
545
546
547
 
549
550
551
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
552
@@ -1,11 +1,9 @@
 #compdef hgtk   -# Zsh completion script for mercurial. -# copy it into your zsh function path (/usr/share/zsh/site-functions for -# instance) +# Zsh completion script for hgtk. +# copy it into your zsh function path (/usr/share/zsh/site-functions)  # -# Copyright (C) 2005-6 Steve Borho -# Copyright (C) 2006-8 Brendan Cully <brendan@kublai.com> +# Copyright (C) 2009 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 @@ -133,7 +131,7 @@
   _hg_commands() {   (( $#_hg_cmd_list )) || _hg_get_commands - _describe -t commands 'mercurial command' _hg_cmd_list + _describe -t commands 'hgtk command' _hg_cmd_list  }    _hg_revrange() { @@ -300,21 +298,10 @@
 # Common options  _hg_global_opts=(   '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' - '--cwd[change working directory]:new working directory:_files -/' - '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]'   '(--verbose -v)'{-v,--verbose}'[enable additional output]' - '*--config[set/override config option]:defined config items:_hg_config'   '(--quiet -q)'{-q,--quiet}'[suppress output]'   '(--help -h)'{-h,--help}'[display help and exit]' - '--debug[debug mode]'   '--debugger[start debugger]' - '--encoding[set the charset encoding (default: UTF8)]' - '--encodingmode[set the charset encoding mode (default: strict)]' - '--lsprof[print improved command execution profile]' - '--traceback[print traceback on exception]' - '--time[time how long the command takes]' - '--profile[profile]' - '--version[output version information and exit]'  )    _hg_pat_opts=( @@ -326,9 +313,6 @@
  '(--git -g)'{-g,--git}'[use git extended diff format]'   "--nodates[don't include dates in diff headers]")   -_hg_dryrun_opts=( - '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') -  _hg_style_opts=(   '--style[display using template map file]:'   '--template[display with template]:') @@ -347,16 +331,10 @@
 }    _hg_cmd_add() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \   '*:unknown files:_hg_unknown'  }   -_hg_cmd_addremove() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ - '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \ - '*:unknown or missing files:_hg_addremove' -} -  _hg_cmd_annotate() {   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \   '(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_tags' \ @@ -369,41 +347,6 @@
  '*:files:_hg_files'  }   -_hg_cmd_archive() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '--no-decode[do not pass files through decoders]' \ - '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \ - '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_tags' \ - '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \ - '*:destination:_files' -} - -_hg_cmd_backout() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '--merge[merge with old dirstate parent after backout]' \ - '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ - '--parent[parent to choose when backing out merge]' \ - '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ - '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ - '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ - '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' -} - -_hg_cmd_bundle() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ - '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ - '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_tags' \ - ':output file:_files' \ - ':destination repository:_files -/' -} - -_hg_cmd_cat() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ - '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ - '*:file:_hg_files' -} -  _hg_cmd_clone() {   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \   '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \ @@ -423,14 +366,7 @@
  '*:file:_hg_files'  }   -_hg_cmd_copy() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ - '(--after -A)'{-A,--after}'[record a copy that has already occurred]' \ - '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ - '*:file:_hg_files' -} - -_hg_cmd_diff() { +_hg_cmd_vdiff() {   typeset -A opt_args   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \   '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \ @@ -479,24 +415,7 @@
   _hg_cmd_help() {   _arguments -s -w : $_hg_global_opts \ - '*:mercurial command:_hg_commands' -} - -_hg_cmd_identify() { - _arguments -s -w : $_hg_global_opts \ - '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_tags' \ - '(--num -n)'{-n+,--num}'[show local revision number]' \ - '(--id -i)'{-i+,--id}'[show global revision id]' \ - '(--branch -b)'{-b+,--branch}'[show branch]' \ - '(--tags -t)'{-t+,--tags}'[show tags]' -} - -_hg_cmd_import() { - _arguments -s -w : $_hg_global_opts \ - '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \ - '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ - '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \ - '*:patch:_files' + '*:hgtk command:_hg_commands'  }    _hg_cmd_incoming() { @@ -515,14 +434,6 @@
  ':dir:_files -/'  }   -_hg_cmd_locate() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_tags' \ - '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ - '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \ - '*:search pattern:_hg_files' -} -  _hg_cmd_log() {   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_style_opts \   '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \ @@ -538,11 +449,6 @@
  '*:files:_hg_files'  }   -_hg_cmd_manifest() { - _arguments -s -w : $_hg_global_opts \ - ':revision:_hg_tags' -} -  _hg_cmd_outgoing() {   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \   '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ @@ -553,17 +459,6 @@
  ':destination:_hg_remote'  }   -_hg_cmd_parents() { - _arguments -s -w : $_hg_global_opts $_hg_style_opts \ - '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_tags' \ - ':last modified file:_hg_files' -} - -_hg_cmd_paths() { - _arguments -s -w : $_hg_global_opts \ - ':path:_hg_paths' -} -  _hg_cmd_pull() {   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ @@ -587,34 +482,17 @@
 }    _hg_cmd_rename() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \   '(--after -A)'{-A,--after}'[record a rename that has already occurred]' \   '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \   '*:file:_hg_files'  }   -_hg_cmd_resolve() { - local context state line - typeset -A opt_args - - _arguments -s -w : $_hg_global_opts \ - '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \ - '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \ - '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \ - '*:file:_hg_unresolved' - - if [[ $state == 'resolve_files' ]] - then - _alternative 'files:resolved files:_hg_resolved' \ - 'files:unresolved files:_hg_unresolved' - fi -} -  _hg_cmd_revert() {   local context state line   typeset -A opt_args   - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \   '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \   '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_tags' \   '--no-backup[do not save backup copies of files]' \ @@ -647,12 +525,6 @@
  '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]'  }   -_hg_cmd_showconfig() { - _arguments -s -w : $_hg_global_opts \ - '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \ - ':config item:_hg_config' -} -  _hg_cmd_status() {   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \   '(--all -A)'{-A,--all}'[show status of all files]' \ @@ -670,27 +542,6 @@
  '*:files:_files'  }   -_hg_cmd_tag() { - _arguments -s -w : $_hg_global_opts \ - '(--local -l)'{-l,--local}'[make the tag local]' \ - '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \ - '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ - '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ - '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_tags' \ - ':tag name:' -} - -_hg_cmd_tip() { - _arguments -s -w : $_hg_global_opts $_hg_style_opts \ - '(--patch -p)'{-p,--patch}'[show patch]' -} - -_hg_cmd_unbundle() { - _arguments -s -w : $_hg_global_opts \ - '(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \ - ':files:_files' -} -  _hg_cmd_update() {   _arguments -s -w : $_hg_global_opts \   '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ @@ -698,178 +549,4 @@
  ':revision:_hg_tags'  }   -# bisect extension -_hg_cmd_bisect() { - _arguments -s -w : $_hg_global_opts ':evaluation:(help init reset next good bad)' -} - -# HGK -_hg_cmd_view() { - _arguments -s -w : $_hg_global_opts \ - '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ - ':revision range:_hg_tags' -} - -# MQ -_hg_qseries() { - typeset -a patches - patches=(${(f)"$(_hg_cmd qseries 2>/dev/null)"}) - (( $#patches )) && _describe -t hg-patches 'patches' patches -} - -_hg_qapplied() { - typeset -a patches - patches=(${(f)"$(_hg_cmd qapplied 2>/dev/null)"}) - if (( $#patches )) - then - patches+=(qbase qtip) - _describe -t hg-applied-patches 'applied patches' patches - fi -} - -_hg_qunapplied() { - typeset -a patches - patches=(${(f)"$(_hg_cmd qunapplied 2>/dev/null)"}) - (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches -} - -_hg_qguards() { - typeset -a guards - local guard - compset -P "+|-" - _hg_cmd qselect -s 2>/dev/null | while read guard - do - guards+=(${guard#(+|-)}) - done - (( $#guards )) && _describe -t hg-guards 'guards' guards -} - -_hg_qseries_opts=( - '(--summary -s)'{-s,--summary}'[print first line of patch header]') - -_hg_cmd_qapplied() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts -} - -_hg_cmd_qdelete() { - _arguments -s -w : $_hg_global_opts \ - '(--keep -k)'{-k,--keep}'[keep patch file]' \ - '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \ - '*:unapplied patch:_hg_qunapplied' -} - -_hg_cmd_qdiff() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '*:pattern:_hg_files' -} - -_hg_cmd_qfold() { - _arguments -s -w : $_hg_global_opts $_h_commit_opts \ - '(--keep,-k)'{-k,--keep}'[keep folded patch files]' \ - '*:unapplied patch:_hg_qunapplied' -} - -_hg_cmd_qgoto() { - _arguments -s -w : $_hg_global_opts \ - '(--force -f)'{-f,--force}'[overwrite any local changes]' \ - ':patch:_hg_qseries' -} - -_hg_cmd_qguard() { - _arguments -s -w : $_hg_global_opts \ - '(--list -l)'{-l,--list}'[list all patches and guards]' \ - '(--none -n)'{-n,--none}'[drop all guards]' \ - ':patch:_hg_qseries' \ - '*:guards:_hg_qguards' -} - -_hg_cmd_qheader() { - _arguments -s -w : $_hg_global_opts \ - ':patch:_hg_qseries' -} - -_hg_cmd_qimport() { - _arguments -s -w : $_hg_global_opts \ - '(--existing -e)'{-e,--existing}'[import file in patch dir]' \ - '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \ - '(--force -f)'{-f,--force}'[overwrite existing files]' \ - '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \ - '*:patch:_files' -} - -_hg_cmd_qnew() { - _arguments -s -w : $_hg_global_opts $_hg_commit_opts \ - '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \ - ':patch:' -} - -_hg_cmd_qnext() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts -} - -_hg_cmd_qpop() { - _arguments -s -w : $_hg_global_opts \ - '(--all -a :)'{-a,--all}'[pop all patches]' \ - '(--name -n)'{-n+,--name}'[queue name to pop]:' \ - '(--force -f)'{-f,--force}'[forget any local changes]' \ - ':patch:_hg_qapplied' -} - -_hg_cmd_qprev() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts -} - -_hg_cmd_qpush() { - _arguments -s -w : $_hg_global_opts \ - '(--all -a :)'{-a,--all}'[apply all patches]' \ - '(--list -l)'{-l,--list}'[list patch name in commit text]' \ - '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \ - '(--name -n)'{-n+,--name}'[merge queue name]:' \ - '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \ - ':patch:_hg_qunapplied' -} - -_hg_cmd_qrefresh() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \ - '(--git -g)'{-g,--git}'[use git extended diff format]' \ - '(--short -s)'{-s,--short}'[short refresh]' \ - '*:files:_hg_files' -} - -_hg_cmd_qrename() { - _arguments -s -w : $_hg_global_opts \ - ':patch:_hg_qseries' \ - ':destination:' -} - -_hg_cmd_qselect() { - _arguments -s -w : $_hg_global_opts \ - '(--none -n :)'{-n,--none}'[disable all guards]' \ - '(--series -s :)'{-s,--series}'[list all guards in series file]' \ - '--pop[pop to before first guarded applied patch]' \ - '--reapply[pop and reapply patches]' \ - '*:guards:_hg_qguards' -} - -_hg_cmd_qseries() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts \ - '(--missing -m)'{-m,--missing}'[print patches not in series]' -} - -_hg_cmd_qunapplied() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts -} - -_hg_cmd_qtop() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts -} - -_hg_cmd_strip() { - _arguments -s -w : $_hg_global_opts \ - '(--force -f)'{-f,--force}'[force multi-head removal]' \ - '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ - '(--nobackup -n)'{-n,--nobackup}'[no backups]' \ - ':revision:_hg_tags' -} -  _hgtk "$@"