Revision: 70877
          http://sourceforge.net/p/brlcad/code/70877
Author:   starseeker
Date:     2018-04-12 13:54:37 +0000 (Thu, 12 Apr 2018)
Log Message:
-----------
Pull in an update from upstream svn2git

Modified Paths:
--------------
    brlcad/trunk/misc/svn2git/svn2git/svn.cpp

Modified: brlcad/trunk/misc/svn2git/svn2git/svn.cpp
===================================================================
--- brlcad/trunk/misc/svn2git/svn2git/svn.cpp   2018-04-12 13:50:45 UTC (rev 
70876)
+++ brlcad/trunk/misc/svn2git/svn2git/svn.cpp   2018-04-12 13:54:37 UTC (rev 
70877)
@@ -68,12 +68,12 @@
 public:
     inline AprAutoPool(apr_pool_t *parent = NULL)
         {
-               pool = svn_pool_create(parent);
-       }
-       inline ~AprAutoPool()
+            pool = svn_pool_create(parent);
+        }
+        inline ~AprAutoPool()
         {
-               svn_pool_destroy(pool);
-       }
+            svn_pool_destroy(pool);
+        }
 
     inline void clear() { svn_pool_clear(pool); }
     inline apr_pool_t *data() const { return pool; }
@@ -1042,10 +1042,29 @@
     SVN_ERR(svn_fs_node_prop(&prop, fs_root, key, "svn:ignore", pool));
     if (prop) {
         *ignore = QString(prop->data);
+        // remove patterns with slashes or backslashes,
+        // they didn't match anything in Subversion but would in Git eventually
+        
ignore->remove(QRegExp("^[^\\r\\n]*[\\\\/][^\\r\\n]*(?:[\\r\\n]|$)|[\\r\\n][^\\r\\n]*[\\\\/][^\\r\\n]*(?=[\\r\\n]|$)"));
+        // add a slash in front to have the same meaning in Git of only 
working on the direct children
+        ignore->replace(QRegExp("(^|[\\r\\n])\\s*(?![\\r\\n]|$)"), "\\1/");
     } else {
         *ignore = QString();
     }
 
+    // Get svn:global-ignores
+    prop = NULL;
+    SVN_ERR(svn_fs_node_prop(&prop, fs_root, key, "svn:global-ignores", pool));
+    if (prop) {
+        QString global_ignore = QString(prop->data);
+        // remove patterns with slashes or backslashes,
+        // they didn't match anything in Subversion but would in Git eventually
+        
global_ignore.remove(QRegExp("^[^\\r\\n]*[\\\\/][^\\r\\n]*(?:[\\r\\n]|$)|[\\r\\n][^\\r\\n]*[\\\\/][^\\r\\n]*(?=[\\r\\n]|$)"));
+        ignore->append(global_ignore);
+    }
+
+    // replace multiple asterisks Subversion meaning by Git meaning
+    ignore->replace(QRegExp("\\*+"), "*");
+
     return EXIT_SUCCESS;
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to