--- python-hglib-2.6.2.orig/Makefile +++ python-hglib-2.6.2/Makefile @@ -1,4 +1,4 @@ -PYTHON=python +PYTHON=python3 help: @echo 'Commonly used make targets:' @echo ' tests - run all tests in the automatic test suite' @@ -14,4 +14,4 @@ TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist tests: - $(PYTHON) test.py --with-doctest + $(PYTHON) -m unittest discover --- python-hglib-2.6.2.orig/debian/changelog +++ python-hglib-2.6.2/debian/changelog @@ -0,0 +1,132 @@ +python-hglib (2.6.2-3) unstable; urgency=medium + + * Add python3-setuptools build dependency (closes: #1080747) + + -- Julien Cristau Fri, 14 Mar 2025 15:34:10 +0100 + +python-hglib (2.6.2-2) unstable; urgency=medium + + * Cherry-pick test fixes: + - stop using deprecated nose (closes: #1018508) + - stop using deprecated methods (closes: #1058228) + + -- Julien Cristau Mon, 15 Jan 2024 17:39:55 +0100 + +python-hglib (2.6.2-1) unstable; urgency=medium + + * New upstream release. + * Switch back to 1.0 source format. + * Drop patches, included upstream. + + -- Julien Cristau Fri, 05 Feb 2021 12:03:36 +0100 + +python-hglib (2.6.1-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Drop python2 support; Closes: #937808 + * debian/patches + - add upstream fixes for mercurial 5.2 compatibility (tests) + - switch to 3.0 (quilt) source format + + -- Sandro Tosi Tue, 31 Dec 2019 17:55:13 -0500 + +python-hglib (2.6.1-1) unstable; urgency=medium + + * New upstream release + * Add Augie Fackler's key to d/u/signing-key.asc. + * Drop Vcs-* control field now alioth is gone. + * Drop old X-Python*-Version control fields. + + -- Julien Cristau Wed, 21 Nov 2018 16:25:54 +0100 + +python-hglib (2.2-1) unstable; urgency=medium + + * New upstream release + + drop fix-tests-for-hg-3.7.diff, merged upstream + * Update Maintainer, Homepage, Vcs-* control fields. + * Bump Standards-Version to 3.9.8 (no changes). + + -- Julien Cristau Fri, 29 Jul 2016 17:41:03 +0200 + +python-hglib (2.0-1) unstable; urgency=medium + + * New upstream release + + fix commit with current mercurial + * Add patch to fix test-merge with current hg + * This all fixes FTBFS and thus closes: #814586 + + -- Julien Cristau Fri, 26 Feb 2016 17:54:30 +0100 + +python-hglib (1.9-1) unstable; urgency=medium + + * New upstream release. + + -- Julien Cristau Thu, 12 Nov 2015 16:26:48 +0100 + +python-hglib (1.7-1) unstable; urgency=medium + + * New upstream release + + fix version in egg-info (closes: #794017) + * Update tests for mercurial 3.5 (closes: #797287) + + -- Julien Cristau Tue, 01 Sep 2015 12:25:21 +0200 + +python-hglib (1.6-1) unstable; urgency=medium + + * New upstream release + * Update debian/watch to use https://pypi.python.org/simple. + * Build a python3-hglib package. + + -- Julien Cristau Sat, 25 Apr 2015 09:29:09 +0200 + +python-hglib (1.4-1) unstable; urgency=medium + + * Let uscan verify tarball signatures. + * New upstream release. + + -- Julien Cristau Sun, 05 Oct 2014 21:59:18 +0200 + +python-hglib (1.3-2) unstable; urgency=medium + + * Switch from python-support to dh_python2. + + -- Julien Cristau Fri, 26 Sep 2014 11:14:08 +0200 + +python-hglib (1.3-1) unstable; urgency=medium + + * New upstream release. + + -- Julien Cristau Fri, 26 Sep 2014 10:48:01 +0200 + +python-hglib (1.2-2) unstable; urgency=medium + + * Fix FTBFS with make 4 (closes: #750230) + + -- Julien Cristau Tue, 17 Jun 2014 09:59:56 +0200 + +python-hglib (1.2-1) unstable; urgency=medium + + * New upstream release. + + -- Julien Cristau Tue, 11 Feb 2014 10:59:46 +0100 + +python-hglib (1.0-1) unstable; urgency=medium + + * New upstream release + - fixes tests (closes: #713093) + + -- Julien Cristau Fri, 24 Jan 2014 14:16:38 +0100 + +python-hglib (0.9-1) unstable; urgency=low + + * New upstream release. + * Change Vcs-* control fields. + * Build-Depend on python-all instead of python. + + -- Julien Cristau Wed, 08 May 2013 15:47:24 +0200 + +python-hglib (0.3-1) unstable; urgency=low + + * Initial release. (Closes: #693879) + + -- Julien Cristau Thu, 22 Nov 2012 11:36:07 +0100 --- python-hglib-2.6.2.orig/debian/clean +++ python-hglib-2.6.2/debian/clean @@ -0,0 +1,4 @@ +# renamed to test_*.py in cherry-picked patch +tests/test-*.py +# removed in cherry-picked patch +test.py --- python-hglib-2.6.2.orig/debian/compat +++ python-hglib-2.6.2/debian/compat @@ -0,0 +1 @@ +7 --- python-hglib-2.6.2.orig/debian/control +++ python-hglib-2.6.2/debian/control @@ -0,0 +1,24 @@ +Source: python-hglib +Section: vcs +Priority: optional +Maintainer: Julien Cristau +Build-Depends: + debhelper (>= 7.0.50), + dh-python, + python3-all, + python3-setuptools, + mercurial (>= 1.9), +Standards-Version: 3.9.8 +Homepage: https://www.mercurial-scm.org/wiki/PythonHglib + +Package: python3-hglib +Architecture: all +Depends: + mercurial (>= 1.9), + ${python3:Depends}, + ${misc:Depends}, +Description: Python3 library for interfacing with Mercurial's command server + python3-hglib is a library with a fast, convenient interface to Mercurial. + It uses Mercurial's command server for communication with hg. This approach + avoids relying on Mercurial's (unstable) internal Python API, and avoids + licensing issues for non-GPL code. --- python-hglib-2.6.2.orig/debian/copyright +++ python-hglib-2.6.2/debian/copyright @@ -0,0 +1,24 @@ +This package was downloaded from + https://pypi.org/project/python-hglib/ + https://www.mercurial-scm.org/repo/python-hglib + +Copyright (c) 2011 Matt Mackall and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- python-hglib-2.6.2.orig/debian/rules +++ python-hglib-2.6.2/debian/rules @@ -0,0 +1,14 @@ +#!/usr/bin/make -f + +%: + dh --with python3 --buildsystem=pybuild $@ + +build: + dh --with python3 --buildsystem=pybuild $@ + +test_%: + $(MAKE) tests PYTHON=$* + +override_dh_auto_test: $(foreach ver, $(shell py3versions -r), test_$(ver)) + +.PHONY: build --- python-hglib-2.6.2.orig/debian/source/format +++ python-hglib-2.6.2/debian/source/format @@ -0,0 +1 @@ +1.0 --- python-hglib-2.6.2.orig/debian/upstream/signing-key.asc +++ python-hglib-2.6.2/debian/upstream/signing-key.asc @@ -0,0 +1,102 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +mQINBE+wFikBEAC4V6mHFMbp1nmufCG7r3o920YtR+wB51HoQSCDoaH+GlXYRsZs +4nEyA9jpGbR5EGRC1lr6VUQgBqds4p1tbAf/5z3z+HiRy7rxQ68gSZzZoaSVG/kP +wTi+hVchnWqvMmZ54piZ/yz8J1IBY+yScfVcqHxPpvEI+u1OfGIT8jzXlkmqiB/S +DAyE1/K65qqlOB3gprG3XQ86e9eUBPCWst887TBSzNVXW64Moc8u5EYQW1OrEr68 +5PyYoXoxfp6I04lL8l5m5hxjw27yxO1me4+iIFghUQMKF95RnrJmXII+Gs67FyyU +YlTyJHXfdf0EhL1IzXf/F9l/bmA/rogeanzE1YHz97m7q/STYM1LRBlWWi0B3QHC +kgmIIM1qM90WS8QqgSyR6weybRGfx1F2cFCqM9sxRLtOUqPiyrCnfQ760HCS18SY +GgyrQ+IT3t3hoO73f3cEV8sJm/XPSDeC93ePUZb+T4n1INwFLZ+TwqN7/Dy6qR8w +G57ieA1aTQvjcojrHVKBrsfHiRKcjenGZZoQdT1XsQvyNL4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GB +IEqLIFOI3j9WQL9VZMuxcbBnIAGg0BUoqeDOvc1TQikeyKsWSah4WRcQhnerH6AX +QB0DUUltDwbpNwKhUootUbg8T+jXcMzN5JkPs+nf1qZIXBy1yrWppKRpUcx2Zb9P +bwZPNLn5sjbYlQ== +=0Esa +-----END PGP PUBLIC KEY BLOCK----- --- python-hglib-2.6.2.orig/debian/watch +++ python-hglib-2.6.2/debian/watch @@ -0,0 +1,2 @@ +version=3 +https://pypi.debian.net/python-hglib/python-hglib-(.*).tar.gz --- python-hglib-2.6.2.orig/tests/__init__.py +++ python-hglib-2.6.2/tests/__init__.py @@ -1,22 +0,0 @@ -import os, tempfile, sys, shutil - -def setUp(): - os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C' - os.environ["EMAIL"] = "Foo Bar " - os.environ['CDPATH'] = '' - os.environ['COLUMNS'] = '80' - os.environ['GREP_OPTIONS'] = '' - os.environ['http_proxy'] = '' - - os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"' - os.environ["HGMERGE"] = "internal:merge" - os.environ["HGUSER"] = "test" - os.environ["HGENCODING"] = "ascii" - os.environ["HGENCODINGMODE"] = "strict" - tmpdir = tempfile.mkdtemp('', 'python-hglib.') - os.environ["HGTMP"] = os.path.realpath(tmpdir) - os.environ["HGRCPATH"] = os.pathsep - -def tearDown(self): - os.chdir('..') - shutil.rmtree(os.environ["HGTMP"]) --- python-hglib-2.6.2.orig/tests/common.py +++ python-hglib-2.6.2/tests/common.py @@ -14,6 +14,22 @@ class basetest(unittest.TestCase): def setUp(self): + os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C' + os.environ["EMAIL"] = "Foo Bar " + os.environ['CDPATH'] = '' + os.environ['COLUMNS'] = '80' + os.environ['GREP_OPTIONS'] = '' + os.environ['http_proxy'] = '' + + os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"' + os.environ["HGMERGE"] = "internal:merge" + os.environ["HGUSER"] = "test" + os.environ["HGENCODING"] = "ascii" + os.environ["HGENCODINGMODE"] = "strict" + tmpdir = tempfile.mkdtemp('', 'python-hglib.') + os.environ["HGTMP"] = os.path.realpath(tmpdir) + os.environ["HGRCPATH"] = os.pathsep + self._testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \ os.path.join(os.environ["HGTMP"], self.__class__.__name__) @@ -37,8 +53,9 @@ if client.server is not None: client.close() os.chdir('..') + try: - shutil.rmtree(self._testtmp) + shutil.rmtree(self._testtmp, ignore_errors=True) except AttributeError: pass # if our setUp was overriden --- python-hglib-2.6.2.orig/tests/test_annotate.py +++ python-hglib-2.6.2/tests/test_annotate.py @@ -0,0 +1,32 @@ +from tests import common +from hglib.util import b + +class test_annotate(common.basetest): + def test_basic(self): + self.append('a', 'a\n') + rev, node0 = self.client.commit(b('first'), addremove=True) + self.append('a', 'a\n') + rev, node1 = self.client.commit(b('second')) + + self.assertEqual(list(self.client.annotate(b('a'))), + [(b('0'), b('a')), (b('1'), b('a'))]) + self.assertEqual(list( + self.client.annotate( + b('a'), user=True, file=True, + number=True, changeset=True, line=True, verbose=True)), + [(b('test 0 ') + node0[:12] + b(' a:1'), b('a')), + (b('test 1 ') + node1[:12] + b(' a:2'), b('a'))]) + + def test_files(self): + self.append('a', 'a\n') + rev, node0 = self.client.commit(b('first'), addremove=True) + self.append('b', 'b\n') + rev, node1 = self.client.commit(b('second'), addremove=True) + self.assertEqual(list(self.client.annotate([b('a'), b('b')])), + [(b('0'), b('a')), (b('1'), b('b'))]) + + def test_two_colons(self): + self.append('a', 'a: b\n') + self.client.commit(b('first'), addremove=True) + self.assertEqual(list(self.client.annotate(b('a'))), + [(b('0'), b('a: b'))]) --- python-hglib-2.6.2.orig/tests/test_bookmarks.py +++ python-hglib-2.6.2/tests/test_bookmarks.py @@ -0,0 +1,26 @@ +from tests import common +from hglib.util import b + +class test_bookmarks(common.basetest): + def test_empty(self): + self.assertEqual(self.client.bookmarks(), ([], -1)) + + def test_basic(self): + self.append('a', 'a') + rev0, node0 = self.client.commit(b('first'), addremove=True) + self.append('a', 'a') + rev1, node1 = self.client.commit(b('second')) + + self.client.bookmark(b('zero'), rev0) + self.assertEqual(self.client.bookmarks(), + ([(b('zero'), rev0, node0[:12])], -1)) + + self.client.bookmark(b('one'), rev1) + self.assertEqual(self.client.bookmarks()[0], + [(b('one'), rev1, node1[:12]), + (b('zero'), rev0, node0[:12])]) + + #def test_spaces(self): + # self.client.bookmark('s pace', self.rev0) + # self.assertEqual(self.client.bookmarks(), + # ([('s pace', 0, self.rev0.node[:12])], -1)) --- python-hglib-2.6.2.orig/tests/test_branch.py +++ python-hglib-2.6.2/tests/test_branch.py @@ -0,0 +1,46 @@ +from tests import common +import hglib +from hglib.util import b + +class test_branch(common.basetest): + def test_empty(self): + self.assertEqual(self.client.branch(), b('default')) + + def test_basic(self): + self.assertEqual(self.client.branch(b('foo')), b('foo')) + self.append('a', 'a') + rev, node = self.client.commit(b('first'), addremove=True) + + rev = self.client.log(node)[0] + + self.assertEqual(rev.branch, b('foo')) + self.assertEqual(self.client.branches(), + [(rev.branch, int(rev.rev), rev.node[:12])]) + + def test_reset_with_name(self): + self.assertRaises(ValueError, self.client.branch, b('foo'), clean=True) + + def test_reset(self): + self.client.branch(b('foo')) + self.assertEqual(self.client.branch(clean=True), b('default')) + + def test_exists(self): + self.append('a', 'a') + self.client.commit(b('first'), addremove=True) + self.client.branch(b('foo')) + self.append('a', 'a') + self.client.commit(b('second')) + self.assertRaises(hglib.error.CommandError, + self.client.branch, b('default')) + + def test_force(self): + self.append('a', 'a') + self.client.commit(b('first'), addremove=True) + self.client.branch(b('foo')) + self.append('a', 'a') + self.client.commit(b('second')) + + self.assertRaises(hglib.error.CommandError, + self.client.branch, b('default')) + self.assertEqual(self.client.branch(b('default'), force=True), + b('default')) --- python-hglib-2.6.2.orig/tests/test_branches.py +++ python-hglib-2.6.2/tests/test_branches.py @@ -0,0 +1,25 @@ +from tests import common +import hglib +from hglib.util import b + +class test_branches(common.basetest): + def test_empty(self): + self.assertEqual(self.client.branches(), []) + + def test_basic(self): + self.append('a', 'a') + rev0 = self.client.commit(b('first'), addremove=True) + self.client.branch(b('foo')) + self.append('a', 'a') + rev1 = self.client.commit(b('second')) + branches = self.client.branches() + + expected = [] + for r, n in (rev1, rev0): + r = self.client.log(r)[0] + expected.append((r.branch, int(r.rev), r.node[:12])) + + self.assertEqual(branches, expected) + + def test_active_closed(self): + pass --- python-hglib-2.6.2.orig/tests/test_bundle.py +++ python-hglib-2.6.2/tests/test_bundle.py @@ -0,0 +1,18 @@ +from tests import common +from hglib.util import b + +class test_bundle(common.basetest): + def test_no_changes(self): + self.append('a', 'a') + rev, node0 = self.client.commit(b('first'), addremove=True) + self.assertFalse(self.client.bundle(b('bundle'), destrepo=b('.'))) + + def test_basic(self): + self.append('a', 'a') + rev, node0 = self.client.commit(b('first'), addremove=True) + self.client.clone(dest=b('other')) + + self.append('a', 'a') + rev, node1 = self.client.commit(b('second')) + + self.assertTrue(self.client.bundle(b('bundle'), destrepo=b('other'))) --- python-hglib-2.6.2.orig/tests/test_clone.py +++ python-hglib-2.6.2/tests/test_clone.py @@ -0,0 +1,16 @@ +import os +from tests import common +import hglib +from hglib.util import b + +class test_clone(common.basetest): + def test_basic(self): + self.append('a', 'a') + self.client.commit(b('first'), addremove=True) + cloned = hglib.clone(b('.'), b('cloned')) + self.assertRaises(ValueError, cloned.log) + cloned.open() + self.assertEqual(self.client.log(), cloned.log()) + + def test_clone_uncompressed(self): + hglib.clone(b('.'), b('cloned'), uncompressed=True) --- python-hglib-2.6.2.orig/tests/test_commit.py +++ python-hglib-2.6.2/tests/test_commit.py @@ -0,0 +1,67 @@ +from tests import common +import hglib, datetime +from hglib.util import b + +class test_commit(common.basetest): + def test_user(self): + self.append('a', 'a') + rev, node = self.client.commit(b('first'), addremove=True, + user=b('foo')) + rev = self.client.log(node)[0] + self.assertEqual(rev.author, b('foo')) + + def test_no_user(self): + self.append('a', 'a') + self.assertRaises(hglib.error.CommandError, + self.client.commit, b('first'), user=b('')) + + def test_close_branch(self): + self.append('a', 'a') + rev0, node0 = self.client.commit(b('first'), addremove=True) + self.client.branch(b('foo')) + self.append('a', 'a') + rev1, node1 = self.client.commit(b('second')) + revclose = self.client.commit(b('closing foo'), closebranch=True) + rev0, rev1, revclose = self.client.log([node0, node1, revclose[1]]) + + self.assertEqual(self.client.branches(), + [(rev0.branch, int(rev0.rev), rev0.node[:12])]) + + self.assertEqual(self.client.branches(closed=True), + [(revclose.branch, int(revclose.rev), + revclose.node[:12]), + (rev0.branch, int(rev0.rev), rev0.node[:12])]) + + def test_message_logfile(self): + self.assertRaises(ValueError, self.client.commit, b('foo'), + logfile=b('bar')) + self.assertRaises(ValueError, self.client.commit) + + def test_date(self): + self.append('a', 'a') + now = datetime.datetime.now().replace(microsecond=0) + rev0, node0 = self.client.commit( + b('first'), addremove=True, + date=now.isoformat(' ').encode('latin-1')) + + self.assertEqual(now, self.client.tip().date) + + def test_amend(self): + self.append('a', 'a') + now = datetime.datetime.now().replace(microsecond=0) + rev0, node0 = self.client.commit( + b('first'), addremove=True, + date=now.isoformat(' ').encode('latin-1')) + + self.assertEqual(now, self.client.tip().date) + + self.append('a', 'a') + rev1, node1 = self.client.commit(amend=True) + self.assertEqual(now, self.client.tip().date) + self.assertNotEqual(node0, node1) + self.assertEqual(1, len(self.client.log())) + + def test_nul_injection(self): + self.append('a', 'a') + self.assertRaises(ValueError, lambda: self.client.commit(b('fail\0-A'))) + self.assertEqual(0, len(self.client.log())) --- python-hglib-2.6.2.orig/tests/test_config.py +++ python-hglib-2.6.2/tests/test_config.py @@ -0,0 +1,37 @@ +from tests import common +import os, hglib +from hglib.util import b + +class test_config(common.basetest): + def setUp(self): + common.basetest.setUp(self) + f = open('.hg/hgrc', 'a') + f.write('[section]\nkey=value\n') + f.close() + self.client = hglib.open() + + def test_basic(self): + config = self.client.config() + + self.assertTrue( + (b('section'), b('key'), b('value')) in self.client.config()) + + self.assertTrue([(b('section'), b('key'), b('value'))], + self.client.config(b('section'))) + self.assertTrue([(b('section'), b('key'), b('value'))], + self.client.config([b('section'), b('foo')])) + self.assertRaises(hglib.error.CommandError, + self.client.config, [b('a.b'), b('foo')]) + + def test_show_source(self): + config = self.client.config(showsource=True) + + self.assertTrue((os.path.abspath(b('.hg/hgrc')) + b(':2'), + b('section'), b('key'), b('value')) in config) + +class test_config_arguments(common.basetest): + def test_basic(self): + client = hglib.open(configs=[b('diff.unified=5'), b('a.b=foo')]) + self.assertEqual(client.config(b('a')), [(b('a'), b('b'), b('foo'))]) + self.assertEqual(client.config(b('diff')), + [(b('diff'), b('unified'), b('5'))]) --- python-hglib-2.6.2.orig/tests/test_context.py +++ python-hglib-2.6.2/tests/test_context.py @@ -0,0 +1,95 @@ +import sys +from tests import common +from hglib.error import CommandError +import hglib +from hglib import context +from hglib.util import b + +class test_context(common.basetest): + def test_non_existent(self): + self.assertRaises(ValueError, context.changectx, self.client, b('foo')) + + def test_basic(self): + self.append('a', 'a') + self.append('b', 'b') + rev0, node0 = self.client.commit(b('first'), addremove=True) + + self.append('c', 'c') + rev1, node1 = self.client.commit(b('second'), addremove=True) + + self.assertRaises(KeyError, self.client.__getitem__, 'doesnotexist') + + ctx = self.client[node0] + + self.assertEqual(ctx.description(), b('first')) + self.assertEqual(str(ctx), node0[:12].decode('latin-1')) + self.assertEqual(ctx.node(), node0) + self.assertEqual(int(ctx), rev0) + self.assertEqual(ctx.rev(), rev0) + self.assertEqual(ctx.branch(), b('default')) + + self.assertTrue(ctx) + + self.assertTrue(b('a') in ctx and b('b') in ctx) + self.assertFalse(b('c') in ctx) + self.assertEqual(list(ctx), [b('a'), b('b')]) + self.assertEqual(ctx.files(), [b('a'), b('b')]) + + self.assertEqual(ctx.modified(), []) + self.assertEqual(ctx.added(), [b('a'), b('b')]) + self.assertEqual(ctx.removed(), []) + self.assertEqual(ctx.ignored(), []) + self.assertEqual(ctx.clean(), []) + + man = {b('a') : b('047b75c6d7a3ef6a2243bd0e99f94f6ea6683597'), + b('b') : b('62452855512f5b81522aa3895892760bb8da9f3f')} + self.assertEqual(ctx.manifest(), man) + + self.assertEqual([int(c) for c in ctx.parents()], [-1]) + self.assertEqual(int(ctx.p1()), -1) + self.assertEqual(int(ctx.p2()), -1) + + self.assertEqual([int(c) for c in ctx.children()], [1]) + self.assertEqual([int(c) for c in ctx.descendants()], [0, 1]) + self.assertEqual([int(c) for c in ctx.ancestors()], [0]) + + self.client.bookmark(b('bookmark'), inactive=True, rev=node0) + self.assertEqual(ctx.bookmarks(), [b('bookmark')]) + + self.client.tag(b('tag'), rev=node0) + # tags are read on construction + self.assertEqual(self.client[node0].tags(), [b('tag')]) + + def test_construction(self): + self.append('a', 'a') + rev0, node0 = self.client.commit(b('first'), addremove=True) + tip = self.client.tip() + + # from client.revision + ctx = context.changectx(self.client, tip) + self.assertEqual(ctx.node(), tip.node) + + # from revset + ctx = context.changectx(self.client, b('all()')) + self.assertEqual(ctx.node(), tip.node) + + def test_in_keyword(self): + """ + test the 'in' keyword using both revision numbers or changeset ids. + """ + if sys.version_info < (2, 7): + return + + self.append('a', 'a') + rev0, node0 = self.client.commit(b('first'), addremove=True) + self.append('a', 'a') + rev1, node1 = self.client.commit(b('second')) + + self.assertIn(1, self.client) + hash_1 = self.client.log(0)[0][1] + self.assertIn(hash_1, self.client) + self.assertNotIn(2, self.client) + hash_2 = self.client.log(1)[0][1] + self.assertIn(hash_2, self.client) + hash_2 = b('deadbeef') + self.assertNotIn(hash_2, self.client) --- python-hglib-2.6.2.orig/tests/test_copy.py +++ python-hglib-2.6.2/tests/test_copy.py @@ -0,0 +1,23 @@ +from tests import common +import hglib +from hglib.util import b + +class test_copy(common.basetest): + def test_basic(self): + self.append('a', 'a') + self.client.commit(b('first'), addremove=True) + + self.assertTrue(self.client.copy(b('a'), b('b'))) + self.assertEqual(self.client.status(), [(b('A'), b('b'))]) + self.append('c', 'a') + self.assertTrue(self.client.copy(b('a'), b('c'), after=True)) + self.assertEqual(self.client.status(), + [(b('A'), b('b')), (b('A'), b('c'))]) + + # hg returns 0 even if there were warnings + #def test_warnings(self): + # self.append('a', 'a') + # self.client.commit('first', addremove=True) + + # self.assertTrue(self.client.copy('a', 'b')) + # self.assertFalse(self.client.copy('a', 'b')) --- python-hglib-2.6.2.orig/tests/test_diff.py +++ python-hglib-2.6.2/tests/test_diff.py @@ -0,0 +1,48 @@ +from tests import common +from hglib.util import b + +class test_diff(common.basetest): + def test_basic(self): + self.append('a', 'a\n') + self.client.add(b('a')) + diff1 = b("""diff -r 000000000000 a +--- /dev/null ++++ b/a +@@ -0,0 +1,1 @@ ++a +""") + self.assertEqual(diff1, self.client.diff(nodates=True)) + self.assertEqual(diff1, self.client.diff([b('a')], nodates=True)) + rev0, node0 = self.client.commit(b('first')) + diff2 = b("""diff -r 000000000000 -r """) + node0[:12] + b(""" a +--- /dev/null ++++ b/a +@@ -0,0 +1,1 @@ ++a +""") + self.assertEqual(diff2, self.client.diff(change=rev0, nodates=True)) + self.append('a', 'a\n') + rev1, node1 = self.client.commit(b('second')) + diff3 = b("""diff -r """) + node0[:12] + b(""" a +--- a/a ++++ b/a +@@ -1,1 +1,2 @@ + a ++a +""") + self.assertEqual(diff3, self.client.diff(revs=[rev0], nodates=True)) + diff4 = b("""diff -r """) + node0[:12] + b(" -r ") + node1[:12] + b( + """ a +--- a/a ++++ b/a +@@ -1,1 +1,2 @@ + a ++a +""") + self.assertEqual(diff4, self.client.diff(revs=[rev0, rev1], + nodates=True)) + + def test_basic_plain(self): + with open('.hg/hgrc', 'a') as f: + f.write('[defaults]\ndiff=--git\n') + self.test_basic() --- python-hglib-2.6.2.orig/tests/test_encoding.py +++ python-hglib-2.6.2/tests/test_encoding.py @@ -0,0 +1,8 @@ +from tests import common +import hglib +from hglib.util import b + +class test_encoding(common.basetest): + def test_basic(self): + self.client = hglib.open(encoding='utf-8') + self.assertEqual(self.client.encoding, b('utf-8')) --- python-hglib-2.6.2.orig/tests/test_forget.py +++ python-hglib-2.6.2/tests/test_forget.py @@ -0,0 +1,14 @@ +from tests import common +from hglib.util import b + +class test_forget(common.basetest): + def test_basic(self): + self.append('a', 'a') + self.client.add([b('a')]) + self.assertTrue(self.client.forget(b('a'))) + + def test_warnings(self): + self.assertFalse(self.client.forget(b('a'))) + self.append('a', 'a') + self.client.add([b('a')]) + self.assertFalse(self.client.forget([b('a'), b('b')])) --- python-hglib-2.6.2.orig/tests/test_grep.py +++ python-hglib-2.6.2/tests/test_grep.py @@ -0,0 +1,64 @@ +from tests import common +from hglib.util import b + +class test_grep(common.basetest): + def test_basic(self): + self.append('a', 'x\n') + self.append('b', 'xy\n') + self.client.commit(b('first'), addremove=True) + + # no match + self.assertEqual(list(self.client.grep(b('c'))), []) + + if self.client.version >= (5, 2): + self.assertEqual(list(self.client.grep(b('x'))), + [(b('a'), b('x')), (b('b'), b('xy'))]) + self.assertEqual(list(self.client.grep(b('x'), b('a'))), + [(b('a'), b('x'))]) + + self.assertEqual(list(self.client.grep(b('y'))), + [(b('b'), b('xy'))]) + else: + self.assertEqual(list(self.client.grep(b('x'))), + [(b('a'), b('0'), b('x')), (b('b'), b('0'), b('xy'))]) + self.assertEqual(list(self.client.grep(b('x'), b('a'))), + [(b('a'), b('0'), b('x'))]) + self.assertEqual(list(self.client.grep(b('y'))), + [(b('b'), b('0'), b('xy'))]) + + def test_options(self): + self.append('a', 'x\n') + self.append('b', 'xy\n') + rev, node = self.client.commit(b('first'), addremove=True) + + self.assertEqual([(b('a'), b('0'), b('+'), b('x')), + (b('b'), b('0'), b('+'), b('xy'))], + list(self.client.grep(b('x'), all=True))) + + if self.client.version >= (5, 2): + self.assertEqual([(b('a'),), (b('b'),)], + list(self.client.grep(b('x'), fileswithmatches=True))) + + self.assertEqual([(b('a'), b('1'), b('x')), (b('b'), b('1'), b('xy'))], + list(self.client.grep(b('x'), line=True))) + + self.assertEqual([(b('a'), b('test'), b('x')), + (b('b'), b('test'), b('xy'))], + list(self.client.grep(b('x'), user=True))) + else: + self.assertEqual([(b('a'), b('0')), (b('b'), b('0'))], + list(self.client.grep(b('x'), fileswithmatches=True))) + + self.assertEqual([(b('a'), b('0'), b('1'), b('x')), + (b('b'), b('0'), b('1'), b('xy'))], + list(self.client.grep(b('x'), line=True))) + + self.assertEqual([(b('a'), b('0'), b('test'), b('x')), + (b('b'), b('0'), b('test'), b('xy'))], + list(self.client.grep(b('x'), user=True))) + + self.assertEqual([(b('a'), b('0'), b('1'), b('+'), b('test')), + (b('b'), b('0'), b('1'), b('+'), b('test'))], + list(self.client.grep(b('x'), all=True, user=True, + line=True, + fileswithmatches=True))) --- python-hglib-2.6.2.orig/tests/test_heads.py +++ python-hglib-2.6.2/tests/test_heads.py @@ -0,0 +1,17 @@ +from tests import common +from hglib.util import b + +class test_heads(common.basetest): + def test_empty(self): + self.assertEqual(self.client.heads(), []) + + def test_basic(self): + self.append('a', 'a') + rev, node0 = self.client.commit(b('first'), addremove=True) + self.assertEqual(self.client.heads(), [self.client.tip()]) + + self.client.branch(b('foo')) + self.append('a', 'a') + rev, node1 = self.client.commit(b('second')) + + self.assertEqual(self.client.heads(node0, topological=True), []) --- python-hglib-2.6.2.orig/tests/test_hglib.py +++ python-hglib-2.6.2/tests/test_hglib.py @@ -0,0 +1,25 @@ +from tests import common +import hglib + +class test_hglib(common.basetest): + def setUp(self): + pass + + def test_close_fds(self): + """A weird Python bug that has something to do to inherited file + descriptors, see http://bugs.python.org/issue12786 + """ + common.basetest.setUp(self) + client2 = hglib.open() + self.client.close() + + def test_open_nonexistent(self): + # setup stuff necessary for basetest.tearDown() + self.clients = [] + self._oldopen = hglib.client.hgclient.open + try: + self.clients.append(hglib.open('inexistent')) + # hg 3.5 can't report error (fixed by 7332bf4ae959) + #self.fail('ServerError not raised') + except hglib.error.ServerError as inst: + self.assertTrue('inexistent' in str(inst)) --- python-hglib-2.6.2.orig/tests/test_hidden.py +++ python-hglib-2.6.2/tests/test_hidden.py @@ -0,0 +1,74 @@ +from tests import common +import hglib, datetime +from hglib.error import CommandError +from hglib.util import b + +class test_obsolete_reference(common.basetest): + """make sure obsolete changesets are disabled""" + def test_debugobsolete_failure(self): + f = open('gna1','w') + f.write('g') + f.close() + self.client.add(b('gna1')) + cs = self.client.commit(b('gna1'))[1] #get id + self.assertRaises(CommandError, + self.client.rawcommand, [b('debugobsolete'), cs]) + + +class test_obsolete_baselib(common.basetest): + """base test class with obsolete changesets enabled""" + def setUp(self): + #create an extension which only activates obsolete + super(test_obsolete_baselib, self).setUp() + self.append('.hg/obs.py', + "import mercurial.obsolete\n" + "# 3.2 and later\n" + "mercurial.obsolete.isenabled = lambda r, opt: True\n" + "# Dropped in 5.1\n" + "mercurial.obsolete._enabled = True") + self.append('.hg/hgrc','\n[extensions]\nobs=.hg/obs.py') + +class test_obsolete_client(test_obsolete_baselib): + """check client methods with obsolete changesets enabled""" + def test_debugobsolete_success(self): + """check the obsolete extension is available""" + self.append('gna1','ga') + self.client.add(b('gna1')) + cs = self.client.commit(b('gna1'))[1] #get id + self.client.rawcommand([b('debugobsolete'), cs]) + + def test_obsolete_in(self): + """test the 'hidden' keyword with the 'in' method""" + if self.client.version < (2, 9, 0): + return + self.append('gna1','ga') + self.client.add(b('gna1')) + cs0 = self.client.commit(b('gna1'))[1] #get id + self.append('gna2','gaaa') + self.client.add(b('gna2')) + cs1 = self.client.commit(b('gna2'))[1] #get id + self.client.rawcommand([b('debugobsolete'), cs1]) + self.client.update(cs0) + self.assertFalse(cs1 in self.client) + self.assertTrue(cs0 in self.client) + self.client.hidden = True + self.assertTrue(cs1 in self.client) + +class test_hidden_context(test_obsolete_baselib): + """test the "hidden" context method with obsolete changesets enabled on + hidden and visible changesets""" + def test_hidden(self): + if self.client.version < (2, 9, 0): + return + self.append('gna1','ga') + self.client.add(b('gna1')) + cs0 = self.client.commit(b('gna1'))[1] #get id + ctx0 = self.client[cs0] + self.append('gna2','gaaa') + self.client.add(b('gna2')) + cs1 = self.client.commit(b('gna2'))[1] #get id + ctx1 = self.client[cs1] + self.client.rawcommand([b('debugobsolete'), cs1]) + self.client.update(cs0) + self.assertTrue(ctx1.hidden()) + self.assertFalse(ctx0.hidden()) --- python-hglib-2.6.2.orig/tests/test_import.py +++ python-hglib-2.6.2/tests/test_import.py @@ -0,0 +1,39 @@ +import os +from tests import common +from hglib.util import b, BytesIO + +patch = b(""" +# HG changeset patch +# User test +# Date 0 0 +# Node ID c103a3dec114d882c98382d684d8af798d09d857 +# Parent 0000000000000000000000000000000000000000 +1 + +diff -r 000000000000 -r c103a3dec114 a +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/a Thu Jan 01 00:00:00 1970 +0000 +@@ -0,0 +1,1 @@ ++1 +""") + +class test_import(common.basetest): + def test_basic_cstringio(self): + self.client.import_(BytesIO(patch)) + self.assertEqual(self.client.cat([b('a')]), b('1\n')) + + def test_basic_file(self): + f = open('patch', 'wb') + f.write(patch) + f.close() + + # --no-commit + self.client.import_([b('patch')], nocommit=True) + with open('a') as f: + self.assertEqual(f.read(), '1\n') + + self.client.update(clean=True) + os.remove('a') + + self.client.import_([b('patch')]) + self.assertEqual(self.client.cat([b('a')]), b('1\n')) --- python-hglib-2.6.2.orig/tests/test_init.py +++ python-hglib-2.6.2/tests/test_init.py @@ -0,0 +1,15 @@ +from tests import common +import hglib, shutil +from hglib.util import b + +class test_init(common.basetest): + def test_exists(self): + self.assertRaises(hglib.error.CommandError, hglib.init) + + def test_basic(self): + self.client.close() + self.client = None + shutil.rmtree('.hg') + + self.client = hglib.init().open() + self.assertTrue(self.client.root().endswith(b('test_init'))) --- python-hglib-2.6.2.orig/tests/test_log.py +++ python-hglib-2.6.2/tests/test_log.py @@ -0,0 +1,44 @@ +from tests import common +import hglib +from hglib.util import b + +class test_log(common.basetest): + def test_basic(self): + self.append('a', 'a') + rev0, node0 = self.client.commit(b('first'), addremove=True) + self.append('a', 'a') + rev1, node1 = self.client.commit(b('second')) + + revs = self.client.log() + revs.reverse() + + self.assertTrue(len(revs) == 2) + self.assertEqual(revs[1].node, node1) + + self.assertEqual(revs[0], self.client.log(b('0'))[0]) + self.assertEqual(self.client.log(), self.client.log(files=[b('a')])) + + self.assertEqual(self.client.log(), self.client.log(hidden=True)) + + def test_dash_in_filename(self): + self.append('-a', '-a') + self.client.commit(b('first'), addremove=True) + revs = self.client.log(files=[b('-a')]) + self.assertTrue(len(revs) == 1) + self.assertEqual(revs[0].rev, b('0')) + + def test_empty_short_option(self): + self.append('foobar', 'foobar') + self.client.commit(b('first'), addremove=True) + revs = self.client.log(keyword=b(''), files=[b('foobar')]) + self.assertTrue(len(revs) == 1) + self.assertEqual(revs[0].rev, b('0')) + + # def test_errors(self): + # self.assertRaisesRegexp(CommandError, 'abort: unknown revision', + # self.client.log, 'foo') + # self.append('a', 'a') + # self.client.commit('first', addremove=True) + # self.assertRaisesRegexp(CommandError, + # 'abort: unknown revision', + # self.client.log, 'bar') --- python-hglib-2.6.2.orig/tests/test_manifest.py +++ python-hglib-2.6.2/tests/test_manifest.py @@ -0,0 +1,27 @@ +from tests import common +import hglib, os, stat +from hglib.util import b + +class test_manifest(common.basetest): + def test_basic(self): + self.append('a', 'a') + files = [b('a')] + manifest = [(b('047b75c6d7a3ef6a2243bd0e99f94f6ea6683597'), b('644'), + False, False, b('a'))] + + if os.name == 'posix': + self.append('b', 'b') + os.chmod('b', os.stat('b')[0] | stat.S_IEXEC) + os.symlink('b', 'c') + + files.extend([b('b'), b('c')]) + manifest.extend([(b('62452855512f5b81522aa3895892760bb8da9f3f'), + b('755'), True, False, b('b')), + (b('62452855512f5b81522aa3895892760bb8da9f3f'), + b('644'), False, True, b('c'))]) + + self.client.commit(b('first'), addremove=True) + + self.assertEqual(list(self.client.manifest(all=True)), files) + + self.assertEqual(list(self.client.manifest()), manifest) --- python-hglib-2.6.2.orig/tests/test_merge.py +++ python-hglib-2.6.2/tests/test_merge.py @@ -0,0 +1,78 @@ +from tests import common +import hglib +from hglib.util import b + +class test_merge(common.basetest): + def setUp(self): + common.basetest.setUp(self) + + self.append('a', 'a') + rev, self.node0 = self.client.commit(b('first'), addremove=True) + + self.append('a', 'a') + rev, self.node1 = self.client.commit(b('change')) + + def test_basic(self): + self.client.update(self.node0) + self.append('b', 'a') + rev, node2 = self.client.commit(b('new file'), addremove=True) + self.client.merge(self.node1) + rev, node = self.client.commit(b('merge')) + diff = b("diff -r ") + node2[:12] + b(" -r ") + node[:12] + b(""" a +--- a/a ++++ b/a +@@ -1,1 +1,1 @@ +-a +\ No newline at end of file ++aa +\ No newline at end of file +""") + + self.assertEqual(diff, self.client.diff(change=node, nodates=True)) + + def test_merge_prompt_abort(self): + self.client.update(self.node0) + self.client.remove(b('a')) + self.client.commit(b('remove')) + + self.assertRaises(hglib.error.CommandError, self.client.merge) + + def test_merge_prompt_noninteractive(self): + self.client.update(self.node0) + self.client.remove(b('a')) + rev, node = self.client.commit(b('remove')) + + if self.client.version >= (3, 7): + self.assertRaises(hglib.error.CommandError, + self.client.merge, + cb=hglib.merge.handlers.noninteractive) + else: + self.client.merge(cb=hglib.merge.handlers.noninteractive) + + diff = b("diff -r ") + node[:12] + b(""" a +--- /dev/null ++++ b/a +@@ -0,0 +1,1 @@ ++aa +\ No newline at end of file +""") + self.assertEqual(diff, self.client.diff(nodates=True)) + + def test_merge_prompt_cb(self): + self.client.update(self.node0) + self.client.remove(b('a')) + rev, node = self.client.commit(b('remove')) + + def cb(output): + return b('c') + + self.client.merge(cb=cb) + + diff = b("diff -r ") + node[:12] + b(""" a +--- /dev/null ++++ b/a +@@ -0,0 +1,1 @@ ++aa +\ No newline at end of file +""") + self.assertEqual(diff, self.client.diff(nodates=True)) --- python-hglib-2.6.2.orig/tests/test_move.py +++ python-hglib-2.6.2/tests/test_move.py @@ -0,0 +1,16 @@ +import os +from tests import common +from hglib.util import b + +class test_move(common.basetest): + def test_basic(self): + self.append('a', 'a') + self.client.add(b('a')) + self.assertTrue(self.client.move(b('a'), b('b'))) + + # hg returns 0 even if there were warnings + #def test_warnings(self): + # self.append('a', 'a') + # self.client.add('a') + # os.mkdir('c') + # self.assertFalse(self.client.move(['a', 'b'], 'c')) --- python-hglib-2.6.2.orig/tests/test_outgoing_incoming.py +++ python-hglib-2.6.2/tests/test_outgoing_incoming.py @@ -0,0 +1,53 @@ +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])]) --- python-hglib-2.6.2.orig/tests/test_parents.py +++ python-hglib-2.6.2/tests/test_parents.py @@ -0,0 +1,15 @@ +from tests import common +from hglib.util import b + +class test_parents(common.basetest): + def test_noparents(self): + self.assertEqual(self.client.parents(), None) + + def test_basic(self): + self.append('a', 'a') + rev, node = self.client.commit(b('first'), addremove=True) + self.assertEqual(node, self.client.parents()[0].node) + self.assertEqual(node, self.client.parents(file=b('a'))[0].node) + + def test_two_parents(self): + pass --- python-hglib-2.6.2.orig/tests/test_paths.py +++ python-hglib-2.6.2/tests/test_paths.py @@ -0,0 +1,19 @@ +import os +from tests import common +import hglib +from hglib.util import b + +class test_paths(common.basetest): + def test_basic(self): + f = open('.hg/hgrc', 'a') + f.write('[paths]\nfoo = bar\n') + f.close() + + # hgrc isn't watched for changes yet, have to reopen + self.client = hglib.open() + paths = self.client.paths() + self.assertEqual(len(paths), 1) + self.assertEqual(paths[b('foo')], + os.path.abspath('bar').encode('latin-1')) + self.assertEqual(self.client.paths(b('foo')), + os.path.abspath('bar').encode('latin-1')) --- python-hglib-2.6.2.orig/tests/test_phase.py +++ python-hglib-2.6.2/tests/test_phase.py @@ -0,0 +1,47 @@ +from tests import common +import hglib +from hglib.util import b + +class test_phase(common.basetest): + """test the different ways to use the phase command""" + def test_phase(self): + """test getting data from a single changeset""" + self.append('a', 'a') + rev, node0 = self.client.commit(b('first'), addremove=True) + self.assertEqual([(0, b('draft'))], self.client.phase(node0)) + ctx = self.client[rev] + self.assertEqual(b('draft'), ctx.phase()) + + def test_phase_public(self): + """test phase change from draft to public""" + self.append('a', 'a') + rev, node0 = self.client.commit(b('first'), addremove=True) + self.client.phase(node0, public=True) + self.assertEqual([(0, b('public'))], self.client.phase(node0)) + ctx = self.client[rev] + self.assertEqual(b('public'), ctx.phase()) + + def test_phase_secret(self): + """test phase change from draft to secret""" + self.append('a', 'a') + rev, node0 = self.client.commit(b('first'), addremove=True) + self.assertRaises(hglib.error.CommandError, + self.client.phase, node0, secret=True) + self.client.phase(node0, secret=True, force=True) + self.assertEqual([(0, b('secret'))], self.client.phase(node0)) + ctx = self.client[rev] + self.assertEqual(b('secret'), ctx.phase()) + + + def test_phase_multiple(self): + """test phase changes and show the phases of the different changesets""" + self.append('a', 'a') + rev, node0 = self.client.commit(b('a'), addremove=True) + self.client.phase(node0, public=True) + self.append('b', 'b') + rev, node1 = self.client.commit(b('b'), addremove=True) + self.append('c', 'c') + rev, node2 = self.client.commit(b('c'), addremove=True) + self.client.phase(node2, secret=True, force=True) + self.assertEqual([(0, b('public')), (2, b('secret')), (1, b('draft'))], + self.client.phase([node0, node2, node1])) --- python-hglib-2.6.2.orig/tests/test_pull.py +++ python-hglib-2.6.2/tests/test_pull.py @@ -0,0 +1,31 @@ +from tests import common +import hglib +from hglib.util import b + +class test_pull(common.basetest): + def test_basic(self): + self.append('a', 'a') + self.client.commit(b('first'), addremove=True) + + self.client.clone(dest=b('other')) + other = hglib.open(b('other')) + + self.append('a', 'a') + self.client.commit(b('second')) + + self.assertTrue(other.pull()) + self.assertEqual(self.client.log(), other.log()) + + def test_unresolved(self): + self.append('a', 'a') + self.client.commit(b('first'), addremove=True) + + self.client.clone(dest=b('other')) + other = hglib.open(b('other')) + + self.append('a', 'a') + self.client.commit(b('second')) + + self.append('other/a', 'b') + self.assertFalse(other.pull(update=True)) + self.assertTrue((b('M'), b('a')) in other.status()) --- python-hglib-2.6.2.orig/tests/test_push.py +++ python-hglib-2.6.2/tests/test_push.py @@ -0,0 +1,20 @@ +from tests import common +import hglib +from hglib.util import b + +class test_push(common.basetest): + def test_basic(self): + self.append('a', 'a') + self.client.commit(b('first'), addremove=True) + + self.client.clone(dest=b('other')) + other = hglib.open(b('other')) + + # broken in hg, doesn't return 1 if nothing to push + #self.assertFalse(self.client.push('other')) + + self.append('a', 'a') + self.client.commit(b('second')) + + self.assertTrue(self.client.push(b('other'))) + self.assertEqual(self.client.log(), other.log()) --- python-hglib-2.6.2.orig/tests/test_remove.py +++ python-hglib-2.6.2/tests/test_remove.py @@ -0,0 +1,13 @@ +from tests import common +from hglib.util import b + +class test_remove(common.basetest): + def test_basic(self): + self.append('a', 'a') + self.client.commit(b('first'), addremove=True) + self.assertTrue(self.client.remove([b('a')])) + + def test_warnings(self): + self.append('a', 'a') + self.client.commit(b('first'), addremove=True) + self.assertFalse(self.client.remove([b('a'), b('b')])) --- python-hglib-2.6.2.orig/tests/test_resolve.py +++ python-hglib-2.6.2/tests/test_resolve.py @@ -0,0 +1,33 @@ +from tests import common +import hglib +from hglib.util import b + +class test_resolve(common.basetest): + def setUp(self): + common.basetest.setUp(self) + + self.append('a', 'a') + self.append('b', 'b') + rev, self.node0 = self.client.commit(b('first'), addremove=True) + + self.append('a', 'a') + self.append('b', 'b') + rev, self.node1 = self.client.commit(b('second')) + + def test_basic(self): + self.client.update(self.node0) + self.append('a', 'b') + self.append('b', 'a') + rev, self.node3 = self.client.commit(b('third')) + + self.assertRaises(hglib.error.CommandError, self.client.merge, + self.node1) + self.assertRaises(hglib.error.CommandError, + self.client.resolve, all=True) + + self.assertEqual([(b('U'), b('a')), (b('U'), b('b'))], + self.client.resolve(listfiles=True)) + + self.client.resolve(b('a'), mark=True) + self.assertEqual([(b('R'), b('a')), (b('U'), b('b'))], + self.client.resolve(listfiles=True)) --- python-hglib-2.6.2.orig/tests/test_status.py +++ python-hglib-2.6.2/tests/test_status.py @@ -0,0 +1,50 @@ +import os +from tests import common +from hglib.util import b + +class test_status(common.basetest): + def test_empty(self): + self.assertEqual(self.client.status(), []) + + def test_one_of_each(self): + self.append('.hgignore', 'ignored') + self.append('ignored', 'a') + self.append('clean', 'a') + self.append('modified', 'a') + self.append('removed', 'a') + self.append('missing', 'a') + self.client.commit(b('first'), addremove=True) + self.append('modified', 'a') + self.append('added', 'a') + self.client.add([b('added')]) + os.remove('missing') + self.client.remove([b('removed')]) + self.append('untracked') + + l = [(b('M'), b('modified')), + (b('A'), b('added')), + (b('R'), b('removed')), + (b('C'), b('.hgignore')), + (b('C'), b('clean')), + (b('!'), b('missing')), + (b('?'), b('untracked')), + (b('I'), b('ignored'))] + + st = self.client.status(all=True) + + for i in l: + self.assertTrue(i in st) + + def test_copy(self): + self.append('source', 'a') + self.client.commit(b('first'), addremove=True) + self.client.copy(b('source'), b('dest')) + l = [(b('A'), b('dest')), (b(' '), b('source'))] + self.assertEqual(self.client.status(copies=True), l) + + def test_copy_origin_space(self): + self.append('s ource', 'a') + self.client.commit(b('first'), addremove=True) + self.client.copy(b('s ource'), b('dest')) + l = [(b('A'), b('dest')), (b(' '), b('s ource'))] + self.assertEqual(self.client.status(copies=True), l) --- python-hglib-2.6.2.orig/tests/test_summary.py +++ python-hglib-2.6.2/tests/test_summary.py @@ -0,0 +1,135 @@ +import unittest +from tests import common +import hglib +from hglib.util import b + +class test_summary(common.basetest): + def test_empty(self): + d = {b('parent') : [(-1, b('000000000000'), b('tip'), None)], + b('branch') : b('default'), + b('commit') : True, + b('update') : 0} + + self.assertEqual(self.client.summary(), d) + + def test_basic(self): + self.append('a', 'a') + rev, node = self.client.commit(b('first'), addremove=True) + + d = {b('parent') : [(0, node[:12], b('tip'), b('first'))], + b('branch') : b('default'), + b('commit') : True, + b('update') : 0} + if self.client.version >= (3, 5): + d[b('phases')] = b('1 draft') + + self.assertEqual(self.client.summary(), d) + + def test_commit_dirty(self): + self.append('a', 'a') + rev, node = self.client.commit(b('first'), addremove=True) + self.append('a', 'a') + + d = {b('parent') : [(0, node[:12], b('tip'), b('first'))], + b('branch') : b('default'), + b('commit') : False, + b('update') : 0} + if self.client.version >= (3, 5): + d[b('phases')] = b('1 draft') + + self.assertEqual(self.client.summary(), d) + + def test_secret_commit_clean(self): + if self.client.version < (2, 1): + raise unittest.SkipTest('phase not supported') + self.append('a', 'a') + rev, node = self.client.commit(b('first'), addremove=True) + self.client.phase([b('%d') % rev], secret=True, force=True) + e = self.client.summary() + self.assertTrue(e[b('commit')]) + + def test_update(self): + self.append('a', 'a') + rev, node = self.client.commit(b('first'), addremove=True) + self.append('a', 'a') + self.client.commit(b('second')) + self.client.update(0) + + d = {b('parent') : [(0, node[:12], None, b('first'))], + b('branch') : b('default'), + b('commit') : True, + b('update') : 1} + if self.client.version >= (3, 5): + d[b('phases')] = b('2 draft') + + self.assertEqual(self.client.summary(), d) + + def test_remote(self): + self.append('a', 'a') + rev, node = self.client.commit(b('first'), addremove=True) + + self.client.clone(dest=b('other')) + other = hglib.open('other') + + d = {b('parent') : [(0, node[:12], b('tip'), b('first'))], + b('branch') : b('default'), + b('commit') : True, + b('update') : 0, + b('remote') : (0, 0, 0, 0)} + + self.assertEqual(other.summary(remote=True), d) + + self.append('a', 'a') + self.client.commit(b('second')) + + d[b('remote')] = (1, 0, 0, 0) + self.assertEqual(other.summary(remote=True), d) + + self.client.bookmark(b('bm')) + d[b('remote')] = (1, 1, 0, 0) + self.assertEqual(other.summary(remote=True), d) + + other.bookmark(b('bmother')) + d[b('remote')] = (1, 1, 0, 1) + if self.client.version < (2, 0, 0): + d[b('parent')] = [(0, node[:12], b('tip bmother'), b('first'))] + else: + d[b('bookmarks')] = b('*bmother') + self.assertEqual(other.summary(remote=True), d) + + self.append('other/a', 'a') + rev, node = other.commit(b('second in other')) + + d[b('remote')] = (1, 1, 1, 1) + if self.client.version < (2, 0, 0): + tags = b('tip bmother') + else: + tags = b('tip') + d[b('parent')] = [(1, node[:12], tags, b('second in other'))] + if self.client.version >= (3, 5): + d[b('phases')] = b('1 draft') + + self.assertEqual(other.summary(remote=True), d) + + def test_two_parents(self): + self.append('a', 'a') + rev0, node = self.client.commit(b('first'), addremove=True) + + self.append('a', 'a') + rev1, node1 = self.client.commit(b('second')) + + self.client.update(rev0) + self.append('b', 'a') + rev2, node2 = self.client.commit(b('third'), addremove=True) + + self.client.merge(rev1) + + d = {b('parent') : [(2, node2[:12], b('tip'), b('third')), + (1, node1[:12], None, b('second'))], + b('branch') : b('default'), + b('commit') : False, + b('update') : 0} + if self.client.version >= (3, 5): + d[b('phases')] = b('3 draft') + + self.assertEqual(self.client.summary(), d) --- python-hglib-2.6.2.orig/tests/test_tags.py +++ python-hglib-2.6.2/tests/test_tags.py @@ -0,0 +1,21 @@ +from tests import common +import hglib +from hglib.util import b + +class test_tags(common.basetest): + def test_basic(self): + self.append('a', 'a') + rev, node = self.client.commit(b('first'), addremove=True) + self.client.tag(b('my tag')) + self.client.tag(b('local tag'), rev=rev, local=True) + + # filecache that was introduced in 2.0 makes us see the local tag, for + # now we have to reconnect + if self.client.version < (2, 0, 0): + self.client = hglib.open() + + tags = self.client.tags() + self.assertEqual(tags, + [(b('tip'), 1, self.client.tip().node[:12], False), + (b('my tag'), 0, node[:12], False), + (b('local tag'), 0, node[:12], True)]) --- python-hglib-2.6.2.orig/tests/test_update.py +++ python-hglib-2.6.2/tests/test_update.py @@ -0,0 +1,105 @@ +from tests import common +from hglib import error +from hglib.util import b, strtobytes + +class test_update(common.basetest): + def setUp(self): + common.basetest.setUp(self) + self.append('a', 'a') + self.rev0, self.node0 = self.client.commit(b('first'), addremove=True) + self.append('a', 'a') + self.rev1, self.node1 = self.client.commit(b('second')) + + def test_basic(self): + u, m, r, ur = self.client.update(self.rev0) + self.assertEqual(u, 1) + self.assertEqual(m, 0) + self.assertEqual(r, 0) + self.assertEqual(ur, 0) + + def test_unresolved(self): + self.client.update(self.rev0) + self.append('a', 'b') + u, m, r, ur = self.client.update() + self.assertEqual(u, 0) + self.assertEqual(m, 0) + self.assertEqual(r, 0) + self.assertEqual(ur, 1) + self.assertTrue((b('M'), b('a')) in self.client.status()) + + def test_merge(self): + self.append('a', '\n\n\n\nb') + rev2, node2 = self.client.commit(b('third')) + self.append('a', 'b') + self.client.commit(b('fourth')) + self.client.update(rev2) + with open('a') as f: + old = f.read() + f = open('a', 'wb') + f.write(b('a') + old.encode('latin-1')) + f.close() + u, m, r, ur = self.client.update() + self.assertEqual(u, 0) + self.assertEqual(m, 1) + self.assertEqual(r, 0) + self.assertEqual(ur, 0) + self.assertEqual(self.client.status(), [(b('M'), b('a'))]) + + def test_tip(self): + self.client.update(self.rev0) + u, m, r, ur = self.client.update() + self.assertEqual(u, 1) + self.assertEqual(self.client.parents()[0].node, self.node1) + + self.client.update(self.rev0) + self.append('a', 'b') + rev2, node2 = self.client.commit(b('new head')) + self.client.update(self.rev0) + + self.client.update() + self.assertEqual(self.client.parents()[0].node, node2) + + def test_check_clean(self): + self.assertRaises(ValueError, self.client.update, clean=True, + check=True) + + def test_clean(self): + with open('a') as f: + old = f.read() + self.append('a', 'b') + self.assertRaises(error.CommandError, self.client.update, check=True) + + u, m, r, ur = self.client.update(clean=True) + self.assertEqual(u, 1) + with open('a') as f: + self.assertEqual(old, f.read()) + + def test_basic_plain(self): + f = open('.hg/hgrc', 'a') + f.write('[defaults]\nupdate=-v\n') + f.close() + self.test_basic() + + def disabled_largefiles(self): + # we don't run reposetup after a session has started, so this + # test is broken + import os + f = open('.hg/hgrc', 'a') + f.write('[extensions]\nlargefiles=\n') + f.close() + self.append('b', 'a') + try: + self.client.rawcommand([b('add'), b('b'), b('--large')]) + except error.CommandError: + return + + rev2, node2 = self.client.commit(b('third')) + # Go back to 0 + self.client.rawcommand([b('update'), strtobytes(self.rev0)], + # Keep the 'changed' version + prompt=lambda s, d: 'c\n') + u, m, r, ur = self.client.update(rev2, clean=True) + self.assertEqual(u, 2) + self.assertEqual(m, 0) + self.assertEqual(r, 0) + self.assertEqual(ur, 0) --- python-hglib-2.6.2.orig/tox.ini +++ python-hglib-2.6.2/tox.ini @@ -0,0 +1,24 @@ +[tox] +envlist = hg37,hg38,hg39,hg40,hg41,hg42,hg43,hg44,hg45,hg46,hg47,hg48,hg49,hg50,hg51,hg52 + +[testenv] +deps= + nose + hg37: Mercurial==3.7.3 + hg38: Mercurial==3.8.3 + hg39: Mercurial==3.8.3 + hg40: Mercurial==4.0.2 + hg41: Mercurial==4.1.3 + hg42: Mercurial==4.2.2 + hg43: Mercurial==4.3.1 + hg44: Mercurial==4.4.2 + hg45: Mercurial==4.5.3 + hg46: Mercurial==4.6.2 + hg47: Mercurial==4.7.2 + hg48: Mercurial==4.8.2 + hg49: Mercurial==4.9.1 + hg50: Mercurial==5.0.2 + hg51: Mercurial==5.1.2 + hg52: Mercurial==5.2.1 + +commands=nosetests {posargs}