module loghelper.repositories.pysvn_helper

Inheritance diagram of pyquickhelper.loghelper.repositories.pysvn_helper

Short summary

module pyquickhelper.loghelper.repositories.pysvn_helper

Gather all pysvn functionalities here. There might be some differences between SVN version, pysvn client version, TortoiseSVN version and Python. If such a case happens, most of the function will call svn using the command line.

source on GitHub

Classes

class

truncated documentation

RepoFile

mimic a svn file

Functions

function

truncated documentation

__get_version_from_version_txt

private function, tries to find a file version.txt which should contains the version number (if svn is not present) …

get_master_location

raises an exception

get_nb_commits

returns the number of commit

get_repo_log

get the latest changes operated on a file in a folder or a subfolder

get_repo_version

get the latest check in number for a specific path

IsRepo

says if it a repository SVN

repo_ls

run ls on a path

Methods

method

truncated documentation

__init__

constructor

__str__

usual

Documentation

Gather all pysvn functionalities here. There might be some differences between SVN version, pysvn client version, TortoiseSVN version and Python. If such a case happens, most of the function will call svn using the command line.

source on GitHub

pyquickhelper.loghelper.repositories.pysvn_helper.IsRepo(location, commandline=True)[source][source]

says if it a repository SVN

Parameters
  • location – (str) location

  • commandline – (bool) use commandline or not

Returns

bool

source on GitHub

class pyquickhelper.loghelper.repositories.pysvn_helper.RepoFile(**args)[source][source]

Bases: object

mimic a svn file

source on GitHub

constructor

Parameters

args – list of members to add

source on GitHub

__init__(**args)[source][source]

constructor

Parameters

args – list of members to add

source on GitHub

__str__()[source][source]

usual

source on GitHub

pyquickhelper.loghelper.repositories.pysvn_helper.__get_version_from_version_txt(path)[source][source]

private function, tries to find a file version.txt which should contains the version number (if svn is not present)

Parameters

path – folder to look, it will look to the the path of this file, some parents directories and finally this path

Returns

the version number

Warning

If version.txt was not found, it throws an exception.

source on GitHub

pyquickhelper.loghelper.repositories.pysvn_helper.get_master_location(path=None, commandline=True)[source][source]

raises an exception

source on GitHub

pyquickhelper.loghelper.repositories.pysvn_helper.get_nb_commits(path=None, commandline=True)[source][source]

returns the number of commit

Parameters
  • path – path to look

  • commandline – if True, use the command line to get the version number, otherwise it uses pysvn

Returns

integer

source on GitHub

pyquickhelper.loghelper.repositories.pysvn_helper.get_repo_log(path=None, file_detail=False, commandline=True)[source][source]

get the latest changes operated on a file in a folder or a subfolder

Parameters
  • path – path to look

  • file_detail – if True, add impacted files

  • commandline – if True, use the command line to get the version number, otherwise it uses pysvn

Returns

list of changes, each change is a list of 4-uple: - author - change number (int) - date (datetime) - comment

The function use a command line if an error occurred. It uses the xml format:

<logentry revision="161">
    <author>xavier dupre</author>
    <date>2013-03-23T15:02:50.311828Z</date>
    <msg>pyquickhelper: first version</msg>
</logentry>

When a path includes a symbol @, another one must added to the path to avoid the following error to happen:

svn: E205000: Syntax error parsing peg revision 'something@somewhere.fr-'

source on GitHub

pyquickhelper.loghelper.repositories.pysvn_helper.get_repo_version(path=None, commandline=True, log=False)[source][source]

get the latest check in number for a specific path

Parameters
  • path – path to look

  • commandline – if True, use the command line to get the version number, otherwise it uses pysvn

  • log – if True, returns the output instead of a boolean

Returns

integer (check in number)

When a path includes a symbol @, another one must added to the path to avoid the following error to happen:

svn: E205000: Syntax error parsing peg revision 'something@somewhere.fr-'

source on GitHub

pyquickhelper.loghelper.repositories.pysvn_helper.repo_ls(full, commandline=True)[source][source]

run ls on a path

Parameters
  • full – full path

  • commandline – use command line instead of pysvn

Returns

output of client.ls

When a path includes a symbol @, another one must added to the path to avoid the following error to happen:

svn: E205000: Syntax error parsing peg revision 'something@somewhere.fr-'

source on GitHub