A snapshot of a VCS project, an instance of a repository’s files.
A vcsunit is a VCS module (component) snapshot, which represents an actual directory of files (eg. a repository, branch combination, or a repository, directory, date one). VcsUnits can be checked-out and managed like any real set of actual files.
It can be considered as the equivalent of a filesystem’s directory.
>>> u = VcsUnit.objects.create(name="Foo")
>>> u = VcsUnit.objects.get(name="Foo")
>>> print u.name
Foo
>>> VcsUnit.objects.create( name="Foo")
Traceback (most recent call last):
...
IntegrityError: column name is not unique
>>> u.delete()
Define the testing suite for Django’s test runner.
Enables test execution with ./manage.py test <appname>.
A browser class for Bazaar repositories.
Bazaar homepage: http://bazaar-vcs.org/
>>> b = BzrBrowser(
... root='http://fedorapeople.org/~wtogami/temp/InstantMirror/',
... name='test-bzr')
>>> BzrBrowser(root='foo', name='../..')
Traceback (most recent call last):
...
AssertionError: Unit checkout path outside of nominal repo checkout path.
Initialize the repo variable on the browser.
If local repo exists, use that. If not, clone/checkout the repo.
Initialize the working tree for the first time.
Commands used: bzr checkout –lightweight <remote_path> <self.path>
A browser class for CVS repositories.
CVS homepage: http://www.nongnu.org/cvs/
>>> b = CvsBrowser(root=':pserver:anonymous@cvs.fedoraproject.org:/cvs/elvis',
... module='switchdesk')
>>> print b.module
switchdesk
>>> b = CvsBrowser(root=':pserver:anonymous@cvs.fedoraproject.org:/cvs/elvis/switchdesk')
>>> print b.module
switchdesk
>>> b.init_repo()
>>> b.update()
>>> CvsBrowser(root='foo', name='../..')
...
AssertionError: Unit checkout path outside of nominal repo checkout path.
Initialize the repo variable on the browser.
If local repo exists, use that. If not, check it out.
Initialize repository for the first time.
Commands used: cvs -d checkout
A browser class for Git repositories.
Git homepage: http://git.or.cz/
>>> b = GitBrowser(root='http://git.fedorahosted.org/git/elections.git',
... name='test-git', branch='master')
>>> GitBrowser(root='foo', name='../..', branch='tip')
Traceback (most recent call last):
...
AssertionError: Unit checkout path outside of nominal repo checkout path.
Initialize the repo variable on the browser.
If local repo exists, use that. If not, clone it.
Initialize repository for the first time.
Commands used: git clone <remote_path> <self.path> if branch != master: git branch <branch> <remote_branch> git co <branch>
A browser class for Mercurial repositories.
Mercurial homepage: http://www.selenic.com/mercurial/
>>> b = HgBrowser(root='http://code.transifex.org/transifex',
... name='test-hg', branch='default')
>>> HgBrowser(root='foo', name='../..', branch='default')
Traceback (most recent call last):
...
AssertionError: Unit checkout path outside of nominal repo checkout path.
Initialize the repo variable on the browser.
If local repo exists, use that. If not, clone it.
Initialize repository for the first time.
Commands used: hg clone <remote_path> <self.path> hg update <branch>
A browser class for Subversion repositories.
Note, that compared to the other Browsers, this one is stateless: It doesn’t require a self.repo object or something, since each command can execute without any preparation. For this reason, init_repo is not doing much.
Subversion homepage: http://subversion.tigris.org/
>>> b = SvnBrowser(name='test-svn', branch='trunk',
... root='http://svn.fedorahosted.org/svn/system-config-language')
>>> SvnBrowser(root='foo', name='../..', branch='trunk')
...
AssertionError: Unit checkout path outside of nominal repo checkout path.
Return the 2nd-level domain from a full hostname.
>>> domain_from_hostname('http://foo.bar.com/')
'bar.com'
>>> domain_from_hostname('http://localhost:8000/foo/bar/')
'localhost'
Mar 02, 2010