# HG changeset patch # User Idan Kamara # Date 1326711150 -7200 # Node ID 9746227239e0ed738a9db3eb103aff5a701e13ac # Parent bd23bc72e6620cb6fc25df6567bad6ee6a2e1ab2 client: fix import --no-commit flag (issue3206) diff -r bd23bc72e662 -r 9746227239e0 hglib/client.py --- a/hglib/client.py Thu Dec 22 19:12:47 2011 +0200 +++ b/hglib/client.py Mon Jan 16 12:52:30 2012 +0200 @@ -834,7 +834,7 @@ input = None args = cmdbuilder('import', strip=strip, force=force, - nocommit=nocommit, bypass=bypass, exact=exact, + no_commit=nocommit, bypass=bypass, exact=exact, importbranch=importbranch, message=message, date=date, user=user, similarity=similarity, _=stdin, *patches) diff -r bd23bc72e662 -r 9746227239e0 tests/test-import.py --- a/tests/test-import.py Thu Dec 22 19:12:47 2011 +0200 +++ b/tests/test-import.py Mon Jan 16 12:52:30 2012 +0200 @@ -1,4 +1,4 @@ -import common, cStringIO +import common, cStringIO, os import hglib patch = """ @@ -23,5 +23,13 @@ def test_basic_file(self): open('patch', 'wb').write(patch) + + # --no-commit + self.client.import_(['patch'], nocommit=True) + self.assertEquals(open('a').read(), '1\n') + + self.client.update(clean=True) + os.remove('a') + self.client.import_(['patch']) self.assertEquals(self.client.cat(['a']), '1\n')