当前位置: 首页>>代码示例>>Python>>正文


Python Project.revert方法代码示例

本文整理汇总了Python中osc2.wc.project.Project.revert方法的典型用法代码示例。如果您正苦于以下问题:Python Project.revert方法的具体用法?Python Project.revert怎么用?Python Project.revert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osc2.wc.project.Project的用法示例。


在下文中一共展示了Project.revert方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_revert3

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import revert [as 别名]
 def test_revert3(self):
     """revert a missing package"""
     path = self.fixture_file('prj_revert')
     prj = Project(path)
     self.assertEqual(prj._status('xxx'), '!')
     self._not_exists(path, 'xxx')
     prj.revert('xxx')
     self.assertEqual(prj._status('xxx'), ' ')
     self._exists(path, 'xxx')
     self._exists(path, 'xxx', 'dummy')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:12,代码来源:test_project.py

示例2: test_revert5

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import revert [as 别名]
 def test_revert5(self):
     """revert a deleted package (dir does not exist)"""
     path = self.fixture_file('prj_revert')
     prj = Project(path)
     self.assertEqual(prj._status('del'), 'D')
     self._not_exists(path, 'del')
     prj.revert('del')
     self.assertEqual(prj._status('del'), ' ')
     self._exists(path, 'del')
     pkg = prj.package('del')
     self.assertEqual(pkg.status('file'), ' ')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:13,代码来源:test_project.py

示例3: test_revert7

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import revert [as 别名]
 def test_revert7(self):
     """revert all packages"""
     path = self.fixture_file('prj_revert')
     prj = Project(path)
     # just check the state of some packages
     self.assertEqual(prj._status('modified'), ' ')
     self.assertEqual(prj._status('deleted'), 'D')
     self.assertEqual(prj._status('xxx'), '!')
     prj.revert()
     self.assertEqual(prj._status('modified'), ' ')
     self.assertEqual(prj._status('deleted'), ' ')
     self.assertEqual(prj._status('xxx'), ' ')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:14,代码来源:test_project.py

示例4: test_revert6

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import revert [as 别名]
 def test_revert6(self):
     """revert a package whose storedir was deleted"""
     path = self.fixture_file('prj_revert')
     prj = Project(path)
     self.assertEqual(prj._status('modified_no_storedir'), ' ')
     self._not_exists(path, 'modified_no_storedir', '.osc')
     prj.revert('modified_no_storedir')
     self._exists(path, 'modified_no_storedir', '.osc')
     self.assertEqual(prj._status('modified_no_storedir'), ' ')
     pkg = prj.package('modified_no_storedir')
     self.assertEqual(pkg.status('add'), '?')
     self.assertEqual(pkg.status('file'), ' ')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:14,代码来源:test_project.py

示例5: test_revert1

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import revert [as 别名]
 def test_revert1(self):
     """revert modified package"""
     path = self.fixture_file('prj_revert')
     prj = Project(path)
     self.assertEqual(prj._status('modified'), ' ')
     pkg = prj.package('modified')
     self.assertEqual(pkg.status('add'), 'A')
     self.assertEqual(pkg.status('file'), 'M')
     prj.revert('modified')
     self.assertEqual(prj._status('modified'), ' ')
     pkg = prj.package('modified')
     self.assertEqual(pkg.status('add'), '?')
     self.assertEqual(pkg.status('file'), ' ')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:15,代码来源:test_project.py

示例6: test_revert2

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import revert [as 别名]
 def test_revert2(self):
     """revert added package"""
     path = self.fixture_file('prj_revert')
     prj = Project(path)
     self.assertEqual(prj._status('added'), 'A')
     self._exists(path, 'added')
     self._exists(path, 'added', 'foo')
     self._exists(path, 'added', '.osc')
     prj.revert('added')
     self.assertEqual(prj._status('added'), '?')
     # the directory and its files are kept
     self._exists(path, 'added')
     self._exists(path, 'added', 'foo')
     self._not_exists(path, 'added', '.osc')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:16,代码来源:test_project.py

示例7: test_revert4

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import revert [as 别名]
 def test_revert4(self):
     """revert a deleted package (dir exists)"""
     path = self.fixture_file('prj_revert')
     prj = Project(path)
     self.assertEqual(prj._status('deleted'), 'D')
     self._exists(path, 'deleted')
     pkg = prj.package('deleted')
     self.assertEqual(pkg.status('dummy'), 'D')
     self.assertEqual(pkg.status('foo'), 'D')
     self.assertEqual(pkg.status('modified'), 'D')
     self.assertEqual(pkg.status('untracked'), '?')
     prj.revert('deleted')
     self.assertEqual(prj._status('deleted'), ' ')
     self._exists(path, 'deleted')
     pkg = prj.package('deleted')
     self.assertEqual(pkg.status('dummy'), ' ')
     self.assertEqual(pkg.status('foo'), ' ')
     # this file is modified and its old state was 'D'
     # so the new state is 'M' (after the revert)
     self.assertEqual(pkg.status('modified'), 'M')
     # untracked files are kept
     self.assertEqual(pkg.status('untracked'), '?')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:24,代码来源:test_project.py


注:本文中的osc2.wc.project.Project.revert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。