Mercurial > hg
annotate tests/remotefilelog-getflogheads.py @ 43024:188476e48f51
revlog: explicitly set revlogv0 in vfs options
Relying on having an attribute or not for something so fundamental seems too
fragile to me. (And indeed I had issue with that later in this series). So we
explicitly record the fact the repository use revlog-v0.
Differential Revision: https://phab.mercurial-scm.org/D6934
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 27 Sep 2019 06:24:42 +0200 |
parents | 29996f6c2687 |
children | 2372284d9457 |
rev | line source |
---|---|
40495
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
1 from __future__ import absolute_import |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
2 |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
3 from mercurial.i18n import _ |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
4 from mercurial import ( |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
5 hg, |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
6 registrar, |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
7 ) |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
8 |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
9 cmdtable = {} |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
10 command = registrar.command(cmdtable) |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
11 |
41253
29996f6c2687
tests: add missing b prefixes in remotefilelog-getflogheads.py
Augie Fackler <augie@google.com>
parents:
40511
diff
changeset
|
12 @command(b'getflogheads', |
40495
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
13 [], |
41253
29996f6c2687
tests: add missing b prefixes in remotefilelog-getflogheads.py
Augie Fackler <augie@google.com>
parents:
40511
diff
changeset
|
14 b'path') |
40495
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
15 def getflogheads(ui, repo, path): |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
16 """ |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
17 Extension printing a remotefilelog's heads |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
18 |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
19 Used for testing purpose |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
20 """ |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
21 |
41253
29996f6c2687
tests: add missing b prefixes in remotefilelog-getflogheads.py
Augie Fackler <augie@google.com>
parents:
40511
diff
changeset
|
22 dest = repo.ui.expandpath(b'default') |
40495
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
23 peer = hg.peer(repo, {}, dest) |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
24 |
40511
466dd4d70bff
remotefilelog: rename wireproto methods and remaining capabilities
Augie Fackler <augie@google.com>
parents:
40495
diff
changeset
|
25 flogheads = peer.x_rfl_getflogheads(path) |
40495
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
26 |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
27 if flogheads: |
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
28 for head in flogheads: |
41253
29996f6c2687
tests: add missing b prefixes in remotefilelog-getflogheads.py
Augie Fackler <augie@google.com>
parents:
40511
diff
changeset
|
29 ui.write(head + b'\n') |
40495
3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
30 else: |
41253
29996f6c2687
tests: add missing b prefixes in remotefilelog-getflogheads.py
Augie Fackler <augie@google.com>
parents:
40511
diff
changeset
|
31 ui.write(_(b'EMPTY\n')) |