Commits

Patrick Mézard  committed a5be5ca

externals: ignore externals blank or comment lines

  • Participants
  • Parent commits 836aa28

Comments (0)

Files changed (4)

File hgsubversion/svnexternals.py

     defs = []
     for base in sorted(exts):
         for line in exts[base]:
+            if not line.strip() or line.lstrip().startswith('#'):
+                # Ignore comments and blank lines
+                continue
             try:
                 path, rev, source, pegrev, norevline = parsedefinition(line)
             except BadDefinition:

File tests/fixtures/externals.sh

 svn ci -m "set externals on ."
 # Add another one
 cat > externals <<EOF
+# A comment, then an empty line, then a blank line
+
 ^/externals/project1 deps/project1
+    
 -r2 ^/externals/project2@2 deps/project2
 EOF
 svn propset -F externals svn:externals .

File tests/fixtures/externals.svndump

 SVN-fs-dump-format-version: 2
 
-UUID: ac40e40a-7fbf-47e1-90a7-c1de12a5b013
+UUID: 2fcff1c7-6cef-40bf-9072-468ceec83032
 
 Revision-number: 0
 Prop-content-length: 56
 K 8
 svn:date
 V 27
-2009-05-03T14:07:14.149596Z
+2011-02-25T14:33:01.299441Z
 PROPS-END
 
 Revision-number: 1
 K 8
 svn:date
 V 27
-2009-05-03T14:07:14.234026Z
+2011-02-25T14:33:01.321997Z
 PROPS-END
 
 Node-path: branches
 K 8
 svn:date
 V 27
-2009-05-03T14:07:15.135488Z
+2011-02-25T14:33:02.082464Z
 PROPS-END
 
 Node-path: externals/project1
 K 8
 svn:date
 V 27
-2009-05-03T14:07:16.180110Z
+2011-02-25T14:33:03.076026Z
 PROPS-END
 
 Node-path: trunk
 K 8
 svn:date
 V 27
-2009-05-03T14:07:17.092210Z
+2011-02-25T14:33:04.058124Z
 PROPS-END
 
 Node-path: trunk
 Node-kind: dir
 Node-action: change
-Prop-content-length: 111
-Content-length: 111
+Prop-content-length: 169
+Content-length: 169
 
 K 13
 svn:externals
-V 76
+V 133
+# A comment, then an empty line, then a blank line
+
 ^/externals/project1 deps/project1
+    
 -r2 ^/externals/project2@2 deps/project2
 
 PROPS-END
 K 8
 svn:date
 V 27
-2009-05-03T14:07:18.165337Z
+2011-02-25T14:33:05.096545Z
 PROPS-END
 
 Node-path: trunk
 K 8
 svn:date
 V 27
-2009-05-03T14:07:21.092911Z
+2011-02-25T14:33:08.059874Z
 PROPS-END
 
 Node-path: branches/branch1
 K 8
 svn:date
 V 27
-2009-05-03T14:07:23.097507Z
+2011-02-25T14:33:10.059295Z
 PROPS-END
 
 Node-path: branches/branch2
 K 8
 svn:date
 V 27
-2009-05-03T14:07:24.086967Z
+2011-02-25T14:33:11.058317Z
 PROPS-END
 
 Node-path: trunk/subdir
 K 8
 svn:date
 V 27
-2009-05-03T14:07:25.093557Z
+2011-02-25T14:33:12.058270Z
 PROPS-END
 
 Node-path: trunk/subdir2
 K 8
 svn:date
 V 27
-2009-05-03T14:07:27.088306Z
+2011-02-25T14:33:14.058780Z
 PROPS-END
 
 Node-path: externals/project2
 K 8
 svn:date
 V 27
-2009-05-03T14:07:28.065953Z
+2011-02-25T14:33:15.045928Z
 PROPS-END
 
 Node-path: trunk/a

File tests/test_externals.py

  ^/externals/project1 deps/project1
 """
         self.assertEqual(ref0, repo[0]['.hgsvnexternals'].data())
-        ref1 = """[.]
+        ref1 = """\
+[.]
+ # A comment, then an empty line, then a blank line
+ 
  ^/externals/project1 deps/project1
+     
  -r2 ^/externals/project2@2 deps/project2
 """
         self.assertEqual(ref1, repo[1]['.hgsvnexternals'].data())