Mercurial > hg
comparison tests/test-revlog-ancestry.py @ 28764:e677b8daeb3f
py3: use print_function in test-revlog-ancestry.py
author | Robert Stanca <robert.stanca7@gmail.com> |
---|---|
date | Mon, 04 Apr 2016 05:10:11 +0300 |
parents | abe605bbf0de |
children | d466facc5a6e |
comparison
equal
deleted
inserted
replaced
28763:abe605bbf0de | 28764:e677b8daeb3f |
---|---|
1 from __future__ import absolute_import | 1 from __future__ import absolute_import, print_function |
2 import os | 2 import os |
3 from mercurial import ( | 3 from mercurial import ( |
4 hg, | 4 hg, |
5 merge, | 5 merge, |
6 ui, | 6 ui, |
49 | 49 |
50 update(5) | 50 update(5) |
51 addcommit("I", 8) | 51 addcommit("I", 8) |
52 | 52 |
53 # Ancestors | 53 # Ancestors |
54 print 'Ancestors of 5' | 54 print('Ancestors of 5') |
55 for r in repo.changelog.ancestors([5]): | 55 for r in repo.changelog.ancestors([5]): |
56 print r, | 56 print(r, end=' ') |
57 | 57 |
58 print '\nAncestors of 6 and 5' | 58 print('\nAncestors of 6 and 5') |
59 for r in repo.changelog.ancestors([6, 5]): | 59 for r in repo.changelog.ancestors([6, 5]): |
60 print r, | 60 print(r, end=' ') |
61 | 61 |
62 print '\nAncestors of 5 and 4' | 62 print('\nAncestors of 5 and 4') |
63 for r in repo.changelog.ancestors([5, 4]): | 63 for r in repo.changelog.ancestors([5, 4]): |
64 print r, | 64 print(r, end=' ') |
65 | 65 |
66 print '\nAncestors of 7, stop at 6' | 66 print('\nAncestors of 7, stop at 6') |
67 for r in repo.changelog.ancestors([7], 6): | 67 for r in repo.changelog.ancestors([7], 6): |
68 print r, | 68 print(r, end=' ') |
69 | 69 |
70 print '\nAncestors of 7, including revs' | 70 print('\nAncestors of 7, including revs') |
71 for r in repo.changelog.ancestors([7], inclusive=True): | 71 for r in repo.changelog.ancestors([7], inclusive=True): |
72 print r, | 72 print(r, end=' ') |
73 | 73 |
74 print '\nAncestors of 7, 5 and 3, including revs' | 74 print('\nAncestors of 7, 5 and 3, including revs') |
75 for r in repo.changelog.ancestors([7, 5, 3], inclusive=True): | 75 for r in repo.changelog.ancestors([7, 5, 3], inclusive=True): |
76 print r, | 76 print(r, end=' ') |
77 | 77 |
78 # Descendants | 78 # Descendants |
79 print '\n\nDescendants of 5' | 79 print('\n\nDescendants of 5') |
80 for r in repo.changelog.descendants([5]): | 80 for r in repo.changelog.descendants([5]): |
81 print r, | 81 print(r, end=' ') |
82 | 82 |
83 print '\nDescendants of 5 and 3' | 83 print('\nDescendants of 5 and 3') |
84 for r in repo.changelog.descendants([5, 3]): | 84 for r in repo.changelog.descendants([5, 3]): |
85 print r, | 85 print(r, end=' ') |
86 | 86 |
87 print '\nDescendants of 5 and 4' | 87 print('\nDescendants of 5 and 4') |
88 for r in repo.changelog.descendants([5, 4]): | 88 print(*repo.changelog.descendants([5, 4]), sep=' ') |
89 print r, |