本文整理汇总了Python中osc2.wc.project.Project.commit方法的典型用法代码示例。如果您正苦于以下问题:Python Project.commit方法的具体用法?Python Project.commit怎么用?Python Project.commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osc2.wc.project.Project
的用法示例。
在下文中一共展示了Project.commit方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_commit7
# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import commit [as 别名]
def test_commit7(self):
"""test commit (local state: 'A')"""
path = self.fixture_file('prj1')
tl = TL(abort=False)
tl_abort = TL(abort=True)
prj = Project(path, transaction_listener=[tl, tl_abort])
pkg = prj.package('added')
self.assertEqual(pkg.status('foo'), 'A')
self.assertEqual(prj._status('added'), 'A')
prj.commit('added')
# this time no abort
tl = TL(abort=False)
prj = Project(path, transaction_listener=[tl])
pkg = prj.package('added')
self.assertEqual(pkg.status('foo'), 'A')
self.assertEqual(prj._status('added'), 'A')
prj.commit('added')
self.assertEqual(prj._status('added'), ' ')
pkg = prj.package('added')
self.assertEqual(pkg.status('foo'), ' ')
self._exists(path, '.osc', 'data', 'added')
# check transaction listener
self.assertEqual(tl._begin, ['prj_commit', 'commit'])
self.assertEqual(tl._finished, ['commit', 'prj_commit'])
self.assertEqual(tl._transfer, [('upload', 'foo')])
self.assertEqual(set(tl._processed.keys()),
set(['foo', 'added']))
self.assertEqual(tl._processed['foo'], (' ', 'A'))
self.assertEqual(tl._processed['added'], (' ', 'A'))
示例2: test_commit5
# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import commit [as 别名]
def test_commit5(self):
"""test commit (finish pending transaction (delete))"""
path = self.fixture_file('prj2_commit_resume')
prj = Project(path, finish_pending_transaction=False)
self.assertEqual(prj._status('abc'), 'D')
prj.commit('abc')
self.assertEqual(prj._status('abc'), '?')
示例3: test_commit4
# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import commit [as 别名]
def test_commit4(self):
"""test commit (same as test_commit4 but remote package exists)"""
path = self.fixture_file('prj2')
prj = Project(path)
pkg = prj.package('bar')
self.assertEqual(pkg.status('add'), 'A')
self.assertEqual(prj._status('bar'), 'A')
prj.commit('bar')
self.assertEqual(prj._status('bar'), ' ')
pkg = prj.package('bar')
self.assertEqual(pkg.status('add'), ' ')
self._exists(path, '.osc', 'data', 'bar')
示例4: test_commit9
# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import commit [as 别名]
def test_commit9(self):
"""test commit (specify file + comment; local state ' ')"""
path = self.fixture_file('prj2')
prj = Project(path)
pkg = prj.package('foo_modified')
self.assertEqual(pkg.status('file'), 'M')
self.assertEqual(pkg.status('add'), 'A')
self.assertEqual(prj._status('foo'), ' ')
todo = {'foo_modified': ['file']}
prj.commit(package_filenames=todo, comment='foo bar')
self.assertEqual(prj._status('foo'), ' ')
pkg = prj.package('foo_modified')
self.assertEqual(pkg.status('file'), ' ')
self.assertEqual(pkg.status('add'), 'A')
示例5: test_commit2
# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import commit [as 别名]
def test_commit2(self):
"""test commit (local state: 'A')"""
path = self.fixture_file('prj2')
prj = Project(path)
pkg = prj.package('bar')
self.assertEqual(pkg.status('add'), 'A')
self.assertEqual(pkg.status('add2'), 'A')
self.assertEqual(prj._status('bar'), 'A')
prj.commit('bar')
self.assertEqual(prj._status('bar'), ' ')
pkg = prj.package('bar')
self.assertEqual(pkg.status('add'), ' ')
self.assertEqual(pkg.status('add2'), ' ')
self._exists(path, '.osc', 'data', 'bar')
示例6: test_commit1
# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import commit [as 别名]
def test_commit1(self):
"""test commit (local state: ' ')"""
path = self.fixture_file('prj2')
prj = Project(path)
pkg = prj.package('foo_modified')
self.assertEqual(pkg.status('file'), 'M')
self.assertEqual(pkg.status('add'), 'A')
self.assertEqual(prj._status('foo'), ' ')
prj.commit('foo_modified')
self.assertEqual(prj._status('foo'), ' ')
pkg = prj.package('foo_modified')
self.assertEqual(pkg.status('file'), ' ')
self.assertEqual(pkg.status('add'), ' ')
self._not_exists(path, '.osc', '_transaction')
示例7: test_commit10
# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import commit [as 别名]
def test_commit10(self):
"""test commit (specify file + comment; local state 'A')"""
path = self.fixture_file('prj2')
prj = Project(path)
pkg = prj.package('bar')
self.assertEqual(pkg.status('add'), 'A')
self.assertEqual(pkg.status('add2'), 'A')
self.assertEqual(prj._status('bar'), 'A')
todo = {'bar': ['add']}
prj.commit(package_filenames=todo, comment='foo')
self.assertEqual(prj._status('bar'), ' ')
pkg = prj.package('bar')
self.assertEqual(pkg.status('add'), ' ')
self.assertEqual(pkg.status('add2'), 'A')
self._exists(path, '.osc', 'data', 'bar')
示例8: test_commit3
# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import commit [as 别名]
def test_commit3(self):
"""test commit (local state: 'D')"""
path = self.fixture_file('prj2')
prj = Project(path)
pkg = prj.package('abc')
self.assertEqual(pkg.status('modified'), 'D')
self.assertEqual(pkg.status('untracked'), '?')
self.assertEqual(prj._status('abc'), 'D')
prj.commit('abc')
self.assertEqual(prj._status('abc'), '?')
self._exists(path, 'abc')
self._exists(path, 'abc', 'modified')
self._exists(path, 'abc', 'untracked')
self._not_exists(path, 'abc', '.osc')
self._not_exists(path, '.osc', 'data', 'abc')
示例9: test_commit8
# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import commit [as 别名]
def test_commit8(self):
"""test commit delete (local state: 'D' (wc doesn't exist))"""
path = self.fixture_file('prj1')
tl = TL(abort=False)
prj = Project(path, transaction_listener=[tl])
self._not_exists(path, 'missing')
self._exists(path, '.osc', 'data', 'missing')
self.assertEqual(prj._status('missing'), 'D')
prj.commit('missing')
self.assertEqual(prj._status('missing'), '?')
self._not_exists(path, '.osc', 'data', 'missing')
# check transaction listener
self.assertEqual(tl._begin, ['prj_commit'])
self.assertEqual(tl._finished, ['prj_commit'])
self.assertEqual(tl._transfer, [])
self.assertEqual(list(tl._processed.keys()), ['missing'])
self.assertEqual(tl._processed['missing'], (None, 'D'))