Page MenuHomePhabricator

pywikibot fails with SVN version 1.8.11
Closed, ResolvedPublic

Description

SVN format 29 was supported last time I used an SVN checkout (Aug 2014 for 9a2d001c and 7a6dbf4d)

Now SVN on my Fedora box fails with

[workarea] is too old (format 29) to work with client version '1.8.11 (r1643975)' (expects format 31). You need to upgrade the working copy first.

After upgrading the SVN, the following error occurs in both core and compat (slightly different backtrace, failing much earlier):

core$ python pwb.py shell
WARNING: ...pywikibot/tools/ip.py:37: ImportWarning: ipaddress backport is defective; patching.
Welcome to the Pywikibot interactive shell!
>>> import pywikibot
>>> pywikibot.version.getversiondict()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File ".../pywikibot/version.py", line 64, in getversiondict
    (tag, rev, date, hsh) = getversion_svn(_program_dir)
  File ".../pywikibot/version.py", line 171, in getversion_svn
    tag, rev, date = svn_rev_info(_program_dir)
  File ".../pywikibot/version.py", line 102, in svn_rev_info
    entries = open(os.path.join(_program_dir, '.svn/entries'))
IOError: [Errno 2] No such file or directory: '.../.svn/entries'
compat$ python pwb.py shell
setting UA
Traceback (most recent call last):
  File "pwb.py", line 50, in <module>
    import userlib
  File ".../userlib.py", line 13, in <module>
    import wikipedia as pywikibot
  File ".../wikipedia.py", line 6063, in <module>
    versionrev=(version.getversiondict()["rev"])
  File ".../pywikibot/version.py", line 68, in getversiondict
    (tag, rev, date, hsh) = getversion_svn(_program_dir)
  File ".../pywikibot/version.py", line 128, in getversion_svn
    entries = open(os.path.join(_program_dir, '.svn/entries'))
IOError: [Errno 2] No such file or directory: '.../.svn/entries'

And the entries file is missing from the .svn directory.

core$ ls .svn
pristine tmp wc.db

Event Timeline

jayvdb raised the priority of this task from to Needs Triage.
jayvdb updated the task description. (Show Details)
jayvdb subscribed.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptApr 4 2015, 2:39 AM
jayvdb triaged this task as Unbreak Now! priority.Apr 4 2015, 2:40 AM

We have users that cant use GIT, and instead use SVN. Since it is broken, they must not be on a recent SVN version, or they are very quiet :/

jayvdb set Security to None.

There are three dots in the path?

Ah that's not the problem but the missing file in .svn. Have they changed how that path looks?!

Can't reproduce this:

xzise@localhost:~/Programms/pywikibot/core-svn$ svn --version
svn, version 1.8.11 (r1643975)
   compiled Dec 16 2014, 13:31:09 on x86_64-redhat-linux-gnu

Copyright (C) 2014 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository access (RA) modules are available:

* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - using serf 1.3.7
  - handles 'http' scheme
  - handles 'https' scheme
xzise@localhost:~/Programms/pywikibot/core-svn/core$ cat .svn/entries 
12

Now I don't know when svn info was introduced but it could be used instead and maybe fix T95077: pywikibot fails with SVN file formats before 12 too:

core$ svn info --xml
<?xml version="1.0" encoding="UTF-8"?>
<info>
<entry
   path="."
   revision="6313"
   kind="dir">
<url>https://github.com/wikimedia/pywikibot-core/trunk</url>
<relative-url>^/trunk</relative-url>
<repository>
<root>https://github.com/wikimedia/pywikibot-core</root>
<uuid>0f328886-bf45-b297-fba8-ce57b7db7bff</uuid>
</repository>
<wc-info>
<wcroot-abspath>/home/xzise/Programms/pywikibot/core-svn/core</wcroot-abspath>
<schedule>normal</schedule>
<depth>infinity</depth>
</wc-info>
<commit
   revision="6313">
<author>jenkins.bot</author>
<date>2015-04-02T15:00:24.000000Z</date>
</commit>
</entry>
</info>

This returns very cleanly the date and revision. Only the tag is not directly apparent from that and I'm not exactly sure what that tag actually is.

Change 201907 had a related patch set uploaded (by XZise):
[FEAT] version: Use svn info command

https://gerrit.wikimedia.org/r/201907

jayvdb lowered the priority of this task from Unbreak Now! to Medium.Apr 4 2015, 11:07 PM

Can't reproduce this:

xzise@localhost:~/Programms/pywikibot/core-svn$ svn --version
svn, version 1.8.11 (r1643975)
   compiled Dec 16 2014, 13:31:09 on x86_64-redhat-linux-gnu

Copyright (C) 2014 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository access (RA) modules are available:

* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - using serf 1.3.7
  - handles 'http' scheme
  - handles 'https' scheme
xzise@localhost:~/Programms/pywikibot/core-svn/core$ cat .svn/entries 
12

You have the exact same version of SVN.
When I do a fresh checkout using svn 1.8.11, entries does exist.

$ ls .svn
entries  format  pristine  tmp  wc.db
$ cat .svn/entries 
12

So it looks like this problem may only exist when a old svn workarea is upgraded using svn upgrade...?

So it looks like this problem may only exist when a old svn workarea is upgraded using svn upgrade...?

I've confirmed this by using TortoiseSVN 1.8 to svn upgrade an SVN workarea checked out with TortoiseSVN 1.7, and there is no entries file, even after svn update and the SVN Update GUI.

Change 201931 had a related patch set uploaded (by John Vandenberg):
Use setuptools for SVN support

https://gerrit.wikimedia.org/r/201931

Change 201931 merged by jenkins-bot:
Use setuptools for SVN support

https://gerrit.wikimedia.org/r/201931

jayvdb claimed this task.

Technically it's only solved for Pywikibot (yet).

Change 201907 abandoned by XZise:
[FEAT] version: Use svn info command

Reason:
We should remove that svn/git magic… if a user uses git or svn they should be able to tell their git hash/svn revision.

https://gerrit.wikimedia.org/r/201907