Mercurial > hg
comparison tests/test-impexp-branch.t @ 36394:4bc983568016
py3: replace file() with open()
file() is not present in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2417
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 24 Feb 2018 16:07:45 +0530 |
parents | 4d40fd0283d8 |
children | e033fd788bf8 |
comparison
equal
deleted
inserted
replaced
36393:54f4328a07c2 | 36394:4bc983568016 |
---|---|
72 Test --exact and patch header separators (issue3356) | 72 Test --exact and patch header separators (issue3356) |
73 | 73 |
74 $ hg strip --no-backup . | 74 $ hg strip --no-backup . |
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
76 >>> import re | 76 >>> import re |
77 >>> p = file('../r1.patch', 'rb').read() | 77 >>> p = open('../r1.patch', 'rb').read() |
78 >>> p = re.sub(r'Parent\s+', 'Parent ', p) | 78 >>> p = re.sub(r'Parent\s+', 'Parent ', p) |
79 >>> file('../r1-ws.patch', 'wb').write(p) | 79 >>> open('../r1-ws.patch', 'wb').write(p) |
80 $ hg import --exact ../r1-ws.patch | 80 $ hg import --exact ../r1-ws.patch |
81 applying ../r1-ws.patch | 81 applying ../r1-ws.patch |
82 | 82 |
83 $ cd .. | 83 $ cd .. |