Mercurial > python-hglib
view tests/test_outgoing_incoming.py @ 227:484b56ac4aec default tip
hglib: cat accepts a template argument
author | Julien Cristau <jcristau@mozilla.com> |
---|---|
date | Mon, 17 Jun 2024 17:17:58 +0200 |
parents | a2afbf236ca8 |
children |
line wrap: on
line source
from tests import common import hglib from hglib.util import b class test_outgoing_incoming(common.basetest): def test_no_path(self): self.assertRaises(hglib.error.CommandError, self.client.incoming) def test_empty(self): self.client.clone(dest=b('other')) self.other = hglib.open(b('other')) self.assertEqual(self.other.incoming(), []) self.assertEqual(self.other.outgoing(), []) def test_basic(self): self.append('a', 'a') self.client.commit(b('first'), addremove=True) self.append('a', 'a') self.client.commit(b('second')) self.client.clone(dest=b('other')) other = hglib.open(b('other')) self.assertEqual(self.client.log(), other.log()) self.assertEqual(self.client.outgoing(path=b('other')), other.incoming()) self.append('a', 'a') rev, node = self.client.commit(b('third')) out = self.client.outgoing(path=b('other')) self.assertEqual(len(out), 1) self.assertEqual(out[0].node, node) self.assertEqual(out, other.incoming()) def test_bookmarks(self): self.append('a', 'a') self.client.commit(b('first'), addremove=True) self.append('a', 'a') self.client.commit(b('second')) self.client.clone(dest=b('other')) other = hglib.open(b('other')) self.client.bookmark(b('bm1'), 1) self.assertEqual(other.incoming(bookmarks=True), [(b('bm1'), self.client.tip().node[:12])]) self.assertEqual(self.client.outgoing(path=b('other'), bookmarks=True), [(b('bm1'), self.client.tip().node[:12])])