def test_head(self): #branch head hg = self._mk_local_repo() expects = {'author': u'Jan Florian <*****@*****.**>', 'branch': u'closed', 'mess': u'closing', 'node': 'b26fba69aa7b0378bee2a5386f16c14b0f697c18', 'rev': 3, 'short': 'b26fba69aa7b', 'date': dateutil_parse('2012-03-02T15:50:05+0100'), 'files': [], 'tags': [] } self.assertEquals(expects, hg.get_head(branch='closed')) #tip hg = DVCSWrapper(DUMMY_REPO_COPY, vcs='hg') hg.init_repo() new_file = os.path.join(DUMMY_REPO_COPY, TEST_FILE) touch(new_file) hg.commit('always look good. always!') new_file = os.path.join(DUMMY_REPO_COPY, TEST_FILE + '2') touch(new_file) hg.commit('never look bad. never!') tip = hg.get_head() self.assertEquals((u'default', 1), (tip['branch'], tip['rev']))
def _init_repo(self, path): hg = DVCSWrapper(path) hg.init_repo() return hg