Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: subversion complete functions obsolete



Cristiano De Michele wrote on Sat, 24 Aug 2019 20:26 +00:00:
> Dear Daniel,
> first of all thank you for the prompt reply. To reproduce the issue try 
> to do what follows.
> Let's assume that there is a file called 'rescheduler.py' and a 
> directory
> called 'RESCHEDULE_EXAMPLE' in a svn repository (both under version 
> control), then
> > svn diff r<TAB> 
> does not complete it as expected, since it suggests only the directory 
> 'RESCHEDULE_EXAMPLE'.

Interesting.  I can reproduce this in a new repository that contains
just these two entries, but if I go to one of my usual working copies and
modify some files, those files do get offered by the completion.

>  The same odd behavior can be also experienced with 'log' argument 
> (i.e. svn log).

Okay, but note that 'diff' and 'log' would be expected to complete
different things.  'diff' tries to complete only files with local mods;
'log' should complete only filenames that exist on the server.  For example:

Status	diff?	log?
------	-----	----
A	yes	no
M	yes	yes
<space>	no	yes

> With my patch it should provide all possible completions (i.e. all 
> files and disr in the folder), since I removed completely the smart 
> logic,
> 
> which was present in the original functions (i.e. I removed everywhere 
> the -g option and the relative argument of function _file)

As I said in my previous email, simply using _files wouldn't complete
everything that should be completed: files with status '!' or 'D', or
files with 'Depth: exclude', for example.

> (( $+functions[_svn_controlled] )) ||
> _svn_controlled() {
>  sta=$(svn status $REPLY) 
>  stat=$sta[1]
>  [[ $stat != "?" ]]
> }

This sounds right, though the machinery currently in there
(_call_program, cache) should be added back.  Calling 'svn st foo' for
each file individually would be slow.  Also, a '--' should be added.

> (( $+functions[_svn_status] )) ||
> _svn_status() {
> 
>  sta=$(svn status $REPLY) 
>  [[ "$sta" != "" ]]

> }

Not sure.  What about conflicted files?  Unmodified files in a
changelist?  Unmodified files that were locked by another working copy?

> but I am not sure they work as the original versions…
> I agree with you that _svn_conflict could be kept. According
> to what you wrote a possible implementation of _svn_deletedfiles could be
> 
> sta=$(svn status $REPLY) 
> stat=$sta[1]
> [[ $stat == “D" ]]

What about completing foo/bar after «svn rm foo»?

> what do you think?

Thanks a lot for working on this.  Let's try to break this into small,
incremental improvements.

> The patch file is attached,

You sent the diff reversed: the file as in HEAD of master should be the
first argument to diff.  Also, for bonus points, send the diff with a
.txt extension and not compressed.  (Doing so gives it a text/* MIME
type, which makes the diff easier to read on our end.)

Cheers,

Daniel



Messages sorted by: Reverse Date, Date, Thread, Author