Mercurial > public > mercurial-scm > hg
comparison tests/test-status-inprocess.py @ 28766:7f7cd44cd6d5
py3: use print_function in test-status-inprocess.py
author | Robert Stanca <robert.stanca7@gmail.com> |
---|---|
date | Mon, 04 Apr 2016 05:20:40 +0300 |
parents | 7779f9dfd938 |
children | 9d31582dd636 |
comparison
equal
deleted
inserted
replaced
28765:7779f9dfd938 | 28766:7f7cd44cd6d5 |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 from __future__ import absolute_import | 2 from __future__ import absolute_import, print_function |
3 from mercurial.ui import ( | 3 from mercurial.ui import ( |
4 ui, | 4 ui, |
5 ) | 5 ) |
6 from mercurial.localrepo import ( | 6 from mercurial.localrepo import ( |
7 localrepository, | 7 localrepository, |
12 status, | 12 status, |
13 ) | 13 ) |
14 | 14 |
15 u = ui() | 15 u = ui() |
16 | 16 |
17 print '% creating repo' | 17 print('% creating repo') |
18 repo = localrepository(u, '.', create=True) | 18 repo = localrepository(u, '.', create=True) |
19 | 19 |
20 f = open('test.py', 'w') | 20 f = open('test.py', 'w') |
21 try: | 21 try: |
22 f.write('foo\n') | 22 f.write('foo\n') |
23 finally: | 23 finally: |
24 f.close | 24 f.close |
25 | 25 |
26 print '% add and commit' | 26 print('% add and commit') |
27 add(u, repo, 'test.py') | 27 add(u, repo, 'test.py') |
28 commit(u, repo, message='*') | 28 commit(u, repo, message='*') |
29 status(u, repo, clean=True) | 29 status(u, repo, clean=True) |
30 | 30 |
31 | 31 |
32 print '% change' | 32 print('% change') |
33 f = open('test.py', 'w') | 33 f = open('test.py', 'w') |
34 try: | 34 try: |
35 f.write('bar\n') | 35 f.write('bar\n') |
36 finally: | 36 finally: |
37 f.close() | 37 f.close() |