Edgewall Software
Modify

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#8348 closed enhancement (fixed)

project index shows hidden folders like ".svn"

Reported by: anonymous Owned by: Oren Held <oren@…>
Priority: normal Milestone: 0.12
Component: general Version: none
Severity: normal Keywords: bitesized
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

.svn: Error ([Errno 2] No such file or directory: '/var/www/vhosts/projects.xxx.net/httpdocs/projectsdb/.svn/VERSION')

Attachments (2)

trac_8348_add_tracignore_for_project_listing.patch (2.7 KB ) - added by Oren Held <oren@…> 14 years ago.
Project listing: ignore ".*" by default, or use .tracignore for a (crippled) wildcard list of files to ignore
trac_8348_add_tracignore_for_project_listing_new_plus_tests.patch (6.0 KB ) - added by Oren Held <oren@…> 14 years ago.
This patch uses fnmatch instead, plus adds 2 unit tests (with and without .tracignore file)

Download all attachments as: .zip

Change History (15)

comment:1 by Remy Blank, 15 years ago

Milestone: 0.11.6

Yes, we could ignore the most common ones, like .svn, .hg, … Or maybe add a TRAC_ENV_PARENT_IGNORE environment variable to specify them explicitly.

comment:2 by Christian Boos, 15 years ago

… or read glob patterns from a .tracignore file in the TRAC_ENV_PARENT_DIR folder.

in reply to:  2 comment:3 by Remy Blank, 15 years ago

Replying to cboos:

… or read glob patterns from a .tracignore file in the TRAC_ENV_PARENT_DIR folder.

Ooh, unconventional but nifty!

comment:4 by Christian Boos, 15 years ago

Well, inspired from .hgignore of course ;-)

comment:5 by Remy Blank, 14 years ago

Keywords: bitesized added

comment:6 by Oren Held <oren@…>, 14 years ago

from irc:

<MarGarina> Hi, It's Oren from the sprints :) - another room eventually. Regarding #8348, I guess that we'll want .tracignore to be pre-populated with .svn or even .*, but if it's in the projects directory, do we have a way to automatically deploy a default .tracignore file to the projects directory?
<MarGarina> I mean, I guess that most sysadmins mkdir the projects root directory from scratch wherever they decide..
<cboos> MarGarina: maybe just consider that if there's no .tracignore, then it's like if the content is .svn (or .*, yes), but if there is one .tracignore, then just interpret its content strictly (better be explicit, and no big deal to add either .* or .svn)
Last edited 14 years ago by Christian Boos (previous) (diff)

by Oren Held <oren@…>, 14 years ago

Project listing: ignore ".*" by default, or use .tracignore for a (crippled) wildcard list of files to ignore

comment:7 by Oren Held <oren@…>, 14 years ago

Latest patch is BROKEN, sorry. new one comes soon.

comment:8 by Christian Boos, 14 years ago

Please just use something simple like fnmatch, no need for regexps here.

by Oren Held <oren@…>, 14 years ago

This patch uses fnmatch instead, plus adds 2 unit tests (with and without .tracignore file)

comment:9 by Oren Held <oren@…>, 14 years ago

Yup, fnmatch is much more suitable. Wasn't aware it exists, great :)

comment:10 by Christian Boos, 14 years ago

Milestone: next-minor-0.12.x0.12

Patch looks good, but can be cleaned up a bit more:

  • following our TracDev/CodingStyle is important
    • no lines longer than 79 chars
    • no spurious white space s/[ ".*" ]/[".*"]
  • rpartition is new in Python 2.5, we will still support 2.4 for 0.12
  • avoid filter, use list comprehensions (hint: you can nest them)
  • do the f.close() in a finally block

And matches_ignore_patterns could be probably be a one-liner (using from trac.util.compat import any, rstrip("/"))…

comment:11 by Remy Blank, 14 years ago

Resolution: fixed
Status: newclosed

Committed a cleaned up and simplified patch in [9324].

comment:12 by Remy Blank, 14 years ago

Owner: set to Oren Held <oren@…>

comment:13 by Christian Boos, 14 years ago

re. r9325, yet another good reason to add Show content of added files in the changeset view (#4887), as I completely forgot to review main.py…

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Oren Held <oren@…>.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Oren Held <oren@…> to the specified user.

Add Comment


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