[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Questionable use of global ignore for files in unversioned folders

From: Kazutoshi Satoda <k_satoda_at_f2.dion.ne.jp>
Date: 2006-05-31 21:08:47 CEST

I(and my colleague) found that the global ignore setting doesn't work
as expected.

For example, even if I set Thumbs.db into global ignore pattern, add
dialog for an unversioned folder shows Thumbs.db in that folder, and
it is checked by default. I think these files also should be ignored.
The svn command line client does ignore these files.

I have looked into the source code, and found the function
SVNConfig::MatchIgnorePattern(). This function use a file path as
the argument for svn_cstring_match_glob_list(). I think this is
questionable. Isn't this API only for file name(without directory part)?
If it is, attached patch will work. The patch is based on grep-ing
for "MatchIgnorePattern".

Best regards.

--
k_satoda

Index: src/SVN/SVNConfig.cpp
===================================================================
--- src/SVN/SVNConfig.cpp (revision 6665)
+++ src/SVN/SVNConfig.cpp (working copy)
@@ -66,7 +66,7 @@
         return TRUE;
 }
 
-BOOL SVNConfig::MatchIgnorePattern(const CString& sFilepath, apr_array_header_t *patterns)
+BOOL SVNConfig::MatchIgnorePattern(const CString& name, apr_array_header_t *patterns)
 {
         if (patterns == NULL)
                 return FALSE;
Index: src/SVN/SVNConfig.h
===================================================================
--- src/SVN/SVNConfig.h (revision 6665)
+++ src/SVN/SVNConfig.h (working copy)
@@ -51,13 +51,13 @@
         BOOL GetDefaultIgnores(apr_array_header_t** ppPatterns);
 
         /**
- * Checks if the \c sFilepath matches a pattern in the array of
+ * Checks if the \c name matches a pattern in the array of
          * ignore patterns.
- * \param sFilepath the path to check
+ * \param name the name to check
          * \param *patterns the array of ignore patterns. Get this array with GetDefaultIgnores()
- * \return TRUE if the filename matches a pattern, FALSE if it doesn't.
+ * \return TRUE if the name matches a pattern, FALSE if it doesn't.
          */
- static BOOL MatchIgnorePattern(const CString& sFilepath, apr_array_header_t *patterns);
+ static BOOL MatchIgnorePattern(const CString& name, apr_array_header_t *patterns);
 private:
         apr_pool_t * parentpool;
         apr_pool_t * pool; ///< memory pool
Index: src/SVN/SVNStatusListCtrl.cpp
===================================================================
--- src/SVN/SVNStatusListCtrl.cpp (revision 6665)
+++ src/SVN/SVNStatusListCtrl.cpp (working copy)
@@ -661,7 +661,7 @@
         while (filefinder.FindNextFileNoDots())
         {
                 filename.SetFromWin(filefinder.GetFilePath(), filefinder.IsDirectory());
- if (!SVNConfig::MatchIgnorePattern(filename.GetSVNPathString(),pIgnorePatterns))
+ if (!SVNConfig::MatchIgnorePattern(filename.GetFileOrDirectoryName(),pIgnorePatterns))
                 {
                         FileEntry * entry = new FileEntry();
                         entry->path = filename;
@@ -768,7 +768,7 @@
 
                 const FileEntry* entry = AddNewFileEntry(s, svnPath, basePath, bAllDirect, bDirectoryIsExternal);
 
- if ((wcFileStatus == svn_wc_status_unversioned)&&(!SVNConfig::MatchIgnorePattern(entry->path.GetSVNPathString(),pIgnorePatterns)))
+ if ((wcFileStatus == svn_wc_status_unversioned)&&(!SVNConfig::MatchIgnorePattern(entry->path.GetFileOrDirectoryName(),pIgnorePatterns)))
                 {
                         if (entry->isfolder)
                         {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Wed May 31 21:10:45 2006

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.