On Saturday, September 3, 2022 at 11:37:46 AM UTC+2 htc...@gmail.com wrote:

> Hi,
>
> as I outlined in dev group I have been (after long time) updating TSvn 
> hook script and related setting in our repositories.
>
> What I got
> ----------
> consider following repository layout (hopefuly ascii art will get thru)
>
> (root)
>  - trunk/
>  - - hooks/ [ext link to (root)/hooks]
>  - - - hook.js
>  - - foo/
>  - branches/
>  - - test/
>  - - - hooks/ [ext link to (root)/hooks]
>  - - - - hooks.js
>  - - - bar/
>  - hook/
>  - - hooks.js
>
> and following WCs
>
> WC-root checked out from (root)
> WC-trunk checked out from trunk
> WC-branches checked out from branches
> WC-test checked out from branches/test
>
> What I want
> -----------
> for sake of simplicity I will focus on startprecommithook as it is 
> simplest to invoke and I believe all other script will follow same rules.
>
> start commiting any of this will start hook script
> WC-root
> WC-root/trunk
> WC-root/trunk/* - any file within trunk
> WC-root/branches
> WC-root/branches/*
> WC-root/branches/test
>
> wc-trunk
> wc-trunk/*
>
> WC-branches
> WC-branches/test
> WC-branches/test/*
>
> WC-test
> WC-test/*
>
> note:
>  - I'm not picky in what copy script should run as they are same
>  - I have no particular behavior in mind yet for commiting foo and bar, 
> but invoking script if expected
>
> What I've tried
> ---------------
> note: when taking about what script has run I'm using path from start 
> script confimation dialog, if more paths was tried i dont see it.
> note: it seems there is no differece if startprecommithook is set directly 
> or inherited
>
> I will set startcommithook to something like 'wscript 
> %REPOROOT%/hooks/hook.js startcommithook' trying different path
>
> 1) WC-root
> a) %REPOROOT%/hooks/hook.js
>

%REPOROOT% refers to the repo root. So you have so specify
%REPOROOT%/trunk/hooks/hook.js
 
using %REPOROOT+% instead of %REPOROOT% helps if you only check out from 
trunk, or branches/branchXXX with branches created from trunk and having 
the hooks/hook.js.

%REPOROOT+%/hooks/hook.js
should do the trick.

final results and notes
> -----------------------
> - after all it seems inherited or explicit value gives not the same result 
> (e.g. base folder changes)
> - using %REPOROOT+% on (root) does not run any script what is somewhat 
> unexpected
> - it would be great to have this solution (or similar) online in 
> documentation there is some cryptic information, but it is somewhat hard to 
> follow (maybe im just getting old) e.g. 
> https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-propertypage.html#tsvn-dug-propertypage-tsvn-props
> - %REPOROOT% should never try to run script outside of WC, e.g. WC based 
> on bar
>

this is why the script is only run if a user confirms running it.
 

> - is there way to disable script for bar if its parrent have script set 
> (for case it is WC base)
>

Sorry, no.
 

> - using cancel in 'Approve or reject client-side hook script' gives error 
> 'The hook script returned an error: User cancelled' for this case I like no 
> error message.
>

I'll consider changing that.
 

> - It may be good to have warning (similar to new version is avalable) in 
> commit dialog that hook was not approvedin if 'Don't run' was used
>

sorry, but the commit dialog is crowded with controls as it is. If you 
didn't approve it then you know you didn't.
 

> - in Properties dialog 
> - - you are allowed to use remove on inherited value, but it turn it does 
> nothing (except asking if remove recursively or not)
> - - you can see all parents values (i would expect to see only inherited 
> one, at least order should be reversed so closer parent is closer to local 
> value)
>

actually that's a 'feature' of svn: all properties are inherited by 
default. But only a few actually use the inheritance.
 

> - - in context menu having option to turn inherited into local would be 
> nice too
> - - in context menu having option andvaced edit will help as well
> - trying to run update on multiple WCs may end up with error "Error: The 
> hook script returned an error:  Error: The system cannot find the file 
> specified.' with no hint on WC
>

I'll try to extend the error message.
 

-- 
You received this message because you are subscribed to the Google Groups 
"TortoiseSVN" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tortoisesvn+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tortoisesvn/38d63756-ae4c-419d-a247-0e6a84ab241fn%40googlegroups.com.

Reply via email to