Edgewall Software
Modify

Opened 12 years ago

Last modified 14 months ago

#10847 new enhancement

contrib/trac-svn-hook to support TRAC_PARENT_ENV

Reported by: Elan Ruusamäe <glen@…> Owned by:
Priority: normal Milestone: next-stable-1.6.x
Component: version control Version: 1.0-stable
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

this patch adds TRAC_PARENT_ENV support to browser:trunk/contrib/trac-svn-hook

Attachments (4)

trac-svn-hook.patch (1.9 KB ) - added by Elan Ruusamäe <glen@…> 12 years ago.
trac-svn-hook.2.patch (2.0 KB ) - added by Elan Ruusamäe <glen@…> 12 years ago.
fixed VERSION path
trac-svn-hook.3.patch (2.7 KB ) - added by Elan Ruusamäe <glen@…> 12 years ago.
added .tracignore support! :)
trac-svn-hook.4.patch (2.7 KB ) - added by Elan Ruusamäe <glen@…> 12 years ago.
updated doc a bit with .gitignore

Download all attachments as: .zip

Change History (13)

by Elan Ruusamäe <glen@…>, 12 years ago

Attachment: trac-svn-hook.patch added

comment:1 by Christian Boos, 12 years ago

Looks good!

… except that a TracEnvironment doesn't have a conf/VERSION file usually! (it's just <envdir>/VERSION).

Bonus points for supporting .tracignore glob patterns ;-)

by Elan Ruusamäe <glen@…>, 12 years ago

Attachment: trac-svn-hook.2.patch added

fixed VERSION path

comment:2 by Elan Ruusamäe <glen@…>, 12 years ago

btw the comment in browser:trunk/trac/web/main.py@11236 is a bit misleading, it says that it returns .* if file does not exist. first i thought it means everything as was thinking of regexp, but then trying to understand why it does not behave so (as with that pattern would exclude all trac envs, but it did not). perhaps add comment to it that it means "all hidden files" :)

so, my proposition for rewording:

def get_tracignore_patterns(env_parent_dir):
    """Return the list of patterns from env_parent_dir/.tracignore or
    a default pattern of `".*"` matching all hidden files if the file doesn't exist.
    """

by Elan Ruusamäe <glen@…>, 12 years ago

Attachment: trac-svn-hook.3.patch added

added .tracignore support! :)

by Elan Ruusamäe <glen@…>, 12 years ago

Attachment: trac-svn-hook.4.patch added

updated doc a bit with .gitignore

in reply to:  2 comment:3 by Christian Boos, 12 years ago

Replying to Elan Ruusamäe <glen@…>:

btw the comment in browser:trunk/trac/web/main.py@11236 is a bit misleading, it says that it returns .* if file does not exist. first i thought it means everything as was thinking of regexp, but then trying to understand why it does not behave so (as with that pattern would exclude all trac envs, but it did not). perhaps add comment to it that it means "all hidden files" :)

Yep, got mislead myself until I spotted the use of fnmatch in the code ;-)

so, my proposition for rewording:

def get_tracignore_patterns(env_parent_dir):
    """Return the list of patterns from env_parent_dir/.tracignore or
    a default pattern of `".*"` matching all hidden files if the file doesn't exist.
    """

Thanks! And saying "glob pattern" instead of just "pattern".

comment:4 by Elan Ruusamäe <glen@…>, 12 years ago

i think it wouldn't hurt to describe it in human text what the default pattern matches. if reading diagonally could still interpret commonly seen .* pattern as "regex for match anything"…

comment:5 by Elan Ruusamäe <glen@…>, 12 years ago

please commit in :)

comment:6 by Christian Boos, 12 years ago

Milestone: next-stable-1.0.x

Right, forgot to set the milestone.

comment:7 by Ryan J Ollos, 8 years ago

Milestone: next-stable-1.0.xnext-stable-1.2.x

Moved ticket assigned to next-stable-1.0.x since maintenance of 1.0.x is coming to a close. Please move the ticket back if it's critical to fix on 1.0.x.

comment:8 by Ryan J Ollos, 5 years ago

Milestone: next-stable-1.2.xnext-stable-1.4.x

comment:9 by Ryan J Ollos, 14 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.