Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails on subversion project with externals #45

Closed
berhoel opened this issue Feb 5, 2015 · 6 comments
Closed

Fails on subversion project with externals #45

berhoel opened this issue Feb 5, 2015 · 6 comments

Comments

@berhoel
Copy link

berhoel commented Feb 5, 2015

In my subversion project that uses externals I get an error message:

  File "/usr/local/gltools/python/Python-2.7/lib/python2.7/site-packages/check_manifest.py", line 330, in get_vcs_files
    return normalize_names(vcs.get_versioned_files())
  File "/usr/local/gltools/python/Python-2.7/lib/python2.7/site-packages/check_manifest.py", line 310, in get_versioned_files
    for line in output.splitlines()[1:])
  File "/usr/local/gltools/python/Python-2.7/lib/python2.7/site-packages/check_manifest.py", line 310, in <genexpr>
    for line in output.splitlines()[1:])
IndexError: list index out of range

Changing line 310 to

                      for line in output.splitlines()[1:] if line.strip())

fixes the problem for me.

Kind regards
Berthold Höllmann

@mgedmin
Copy link
Owner

mgedmin commented Feb 5, 2015

Ooh, thank you for this interesting use-case. I'll have to add a test.

@berhoel
Copy link
Author

berhoel commented Feb 5, 2015

A stripped down version of the output from svn st -vq looks like

>svn st -vq
                64       64 berhol       .
                64       58 berhol       Makefile
X                                        setup_utils
                64       58 berhol       tox.ini

Performing status on external item at 'setup_utils':
               110      107 berhol       setup_utils
               110      107 berhol       setup_utils/version.py

@mgedmin
Copy link
Owner

mgedmin commented Feb 6, 2015

I now have a failing test case:

diff --git a/tests.py b/tests.py
index eb499ff..452fd6e 100644
--- a/tests.py
+++ b/tests.py
@@ -914,6 +914,19 @@ class SvnHelper(VCSHelper):
 class TestSvn(VCSMixin, unittest.TestCase):
     vcs = SvnHelper()

+    def test_svn_externals(self):
+        from check_manifest import get_vcs_files
+        self.vcs._run('svnadmin', 'create', 'repo2')
+        repo2_url = 'file:///' + os.path.abspath('repo2').replace(os.path.sep, '/')
+        self.vcs._init_vcs()
+        self.vcs._run('svn', 'propset', 'svn:externals', 'ext %s' % repo2_url, '.')
+        self.vcs._run('svn', 'up')
+        self._create_files(['a.txt', 'ext/b.txt'])
+        self.vcs._run('svn', 'add', 'a.txt', 'ext/b.txt')
+        j = os.path.join
+        self.assertEqual(get_vcs_files(),
+                         ['a.txt', j('ext', 'b.txt')])
+

 class TestUserInterface(unittest.TestCase):

I'm now trying to decide if I should improve the plain-text filtering (what if "Performing status on external..." is a locale-dependent translatable string?) or if I should switch to parsing svn st --xml.

@mgedmin mgedmin closed this as completed in 77b0f51 Feb 6, 2015
@mgedmin
Copy link
Owner

mgedmin commented Feb 6, 2015

I pushed a fix to master. @berhoel, can you verify that it works on your repository now?

@berhoel
Copy link
Author

berhoel commented Feb 12, 2015

I can confirm that "check-manifest" is now working with my repository. Thanks.

@mgedmin
Copy link
Owner

mgedmin commented Feb 12, 2015

I released 0.23 with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants