[PATCH 2 of 2] completion: selectively use debugpathcomplete in bash_completion

Nikolaj Sjujskij sterkrig at myopera.com
Mon Apr 15 10:01:18 CDT 2013


Den 2013-03-21 22:17:19 skrev Bryan O'Sullivan <bos at serpentine.com>:

> # HG changeset patch
> # User Bryan O'Sullivan <bryano at fb.com>
> # Date 1363889832 25200
> # Node ID 03374a7a43c726bb80417bfbb9e6a184139221ee
> # Parent  d91fe1c607511dc57cb51e557229c243908a6b39
> completion: selectively use debugpathcomplete in bash_completion
> ...
> As the new debugpathcomplete command does not check the status of
> files, it offers much better performance for commands that only
> care about completing names.
>
> diff --git a/contrib/bash_completion b/contrib/bash_completion
> --- a/contrib/bash_completion
> +++ b/contrib/bash_completion
> @@ -80,6 +80,14 @@ shopt -s extglob

>  	forget)
> -	    _hg_status "a"
> +	    _hg_debugpathcomplete -fa
>  	;;
  While I was thinking about how (or whether) should I use  
debugpathcomplete in zsh_completion, two questions arose:

  1. Why forget should complete only added files? One may want to forget a  
clean or even modified file as well, not only the one (wrongly) added just  
now.

  2. `debugpathcomplete -fa` offering a significant improvement over  
`status -a` seems wrong. `hg status --added` has no more reasons to walk  
workdir than debugpathcomplete, I think.


More information about the Mercurial-devel mailing list