Show More
@@ -13,6 +13,8 b' import os' | |||||
13 | from .i18n import _ |
|
13 | from .i18n import _ | |
14 | from .node import ( |
|
14 | from .node import ( | |
15 | nullid, |
|
15 | nullid, | |
|
16 | wdirid, | |||
|
17 | wdirrev, | |||
16 | ) |
|
18 | ) | |
17 |
|
19 | |||
18 | from . import ( |
|
20 | from . import ( | |
@@ -191,7 +193,6 b' class changesetprinter(object):' | |||||
191 | def _show(self, ctx, copies, props): |
|
193 | def _show(self, ctx, copies, props): | |
192 | '''show a single changeset or file revision''' |
|
194 | '''show a single changeset or file revision''' | |
193 | changenode = ctx.node() |
|
195 | changenode = ctx.node() | |
194 | rev = ctx.rev() |
|
|||
195 |
|
196 | |||
196 | if self.ui.quiet: |
|
197 | if self.ui.quiet: | |
197 | self.ui.write("%s\n" % scmutil.formatchangeid(ctx), |
|
198 | self.ui.write("%s\n" % scmutil.formatchangeid(ctx), | |
@@ -226,8 +227,12 b' class changesetprinter(object):' | |||||
226 | self.ui.write(columns['parent'] % scmutil.formatchangeid(pctx), |
|
227 | self.ui.write(columns['parent'] % scmutil.formatchangeid(pctx), | |
227 | label=label) |
|
228 | label=label) | |
228 |
|
229 | |||
229 |
if self.ui.debugflag |
|
230 | if self.ui.debugflag: | |
230 | mnode = ctx.manifestnode() |
|
231 | mnode = ctx.manifestnode() | |
|
232 | if mnode is None: | |||
|
233 | mnode = wdirid | |||
|
234 | mrev = wdirrev | |||
|
235 | else: | |||
231 | mrev = self.repo.manifestlog.rev(mnode) |
|
236 | mrev = self.repo.manifestlog.rev(mnode) | |
232 | self.ui.write(columns['manifest'] |
|
237 | self.ui.write(columns['manifest'] | |
233 | % scmutil.formatrevnode(self.ui, mrev, mnode), |
|
238 | % scmutil.formatrevnode(self.ui, mrev, mnode), | |
@@ -343,11 +348,7 b' class changesetformatter(changesetprinte' | |||||
343 | for c in ctx.parents()], name='node')) |
|
348 | for c in ctx.parents()], name='node')) | |
344 |
|
349 | |||
345 | if self.ui.debugflag: |
|
350 | if self.ui.debugflag: | |
346 | if ctx.rev() is None: |
|
351 | fm.data(manifest=fm.hexfunc(ctx.manifestnode() or wdirid), | |
347 | hexnode = None |
|
|||
348 | else: |
|
|||
349 | hexnode = fm.hexfunc(ctx.manifestnode()) |
|
|||
350 | fm.data(manifest=hexnode, |
|
|||
351 | extra=fm.formatdict(ctx.extra())) |
|
352 | extra=fm.formatdict(ctx.extra())) | |
352 |
|
353 | |||
353 | files = ctx.p1().status(ctx) |
|
354 | files = ctx.p1().status(ctx) |
@@ -11,6 +11,8 b' from .i18n import _' | |||||
11 | from .node import ( |
|
11 | from .node import ( | |
12 | hex, |
|
12 | hex, | |
13 | nullid, |
|
13 | nullid, | |
|
14 | wdirid, | |||
|
15 | wdirrev, | |||
14 | ) |
|
16 | ) | |
15 |
|
17 | |||
16 | from . import ( |
|
18 | from . import ( | |
@@ -475,8 +477,9 b' def showmanifest(context, mapping):' | |||||
475 | ctx = context.resource(mapping, 'ctx') |
|
477 | ctx = context.resource(mapping, 'ctx') | |
476 | mnode = ctx.manifestnode() |
|
478 | mnode = ctx.manifestnode() | |
477 | if mnode is None: |
|
479 | if mnode is None: | |
478 | # just avoid crash, we might want to use the 'ff...' hash in future |
|
480 | mnode = wdirid | |
479 |
|
|
481 | mrev = wdirrev | |
|
482 | else: | |||
480 | mrev = repo.manifestlog.rev(mnode) |
|
483 | mrev = repo.manifestlog.rev(mnode) | |
481 | mhex = hex(mnode) |
|
484 | mhex = hex(mnode) | |
482 | mapping = context.overlaymap(mapping, {'rev': mrev, 'node': mhex}) |
|
485 | mapping = context.overlaymap(mapping, {'rev': mrev, 'node': mhex}) |
@@ -2126,6 +2126,7 b' clean:' | |||||
2126 | phase: draft |
|
2126 | phase: draft | |
2127 | parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08 |
|
2127 | parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08 | |
2128 | parent: -1:0000000000000000000000000000000000000000 |
|
2128 | parent: -1:0000000000000000000000000000000000000000 | |
|
2129 | manifest: 2147483647:ffffffffffffffffffffffffffffffffffffffff | |||
2129 | user: test |
|
2130 | user: test | |
2130 | date: [A-Za-z0-9:+ ]+ (re) |
|
2131 | date: [A-Za-z0-9:+ ]+ (re) | |
2131 | extra: branch=default |
|
2132 | extra: branch=default | |
@@ -2164,6 +2165,7 b' dirty:' | |||||
2164 | phase: draft |
|
2165 | phase: draft | |
2165 | parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08 |
|
2166 | parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08 | |
2166 | parent: -1:0000000000000000000000000000000000000000 |
|
2167 | parent: -1:0000000000000000000000000000000000000000 | |
|
2168 | manifest: 2147483647:ffffffffffffffffffffffffffffffffffffffff | |||
2167 | user: test |
|
2169 | user: test | |
2168 | date: [A-Za-z0-9:+ ]+ (re) |
|
2170 | date: [A-Za-z0-9:+ ]+ (re) | |
2169 | files: d1/f1 |
|
2171 | files: d1/f1 | |
@@ -2234,7 +2236,7 b' dirty:' | |||||
2234 | "date": [*, 0], (glob) |
|
2236 | "date": [*, 0], (glob) | |
2235 | "desc": "", |
|
2237 | "desc": "", | |
2236 | "extra": {"branch": "default"}, |
|
2238 | "extra": {"branch": "default"}, | |
2237 | "manifest": null, |
|
2239 | "manifest": "ffffffffffffffffffffffffffffffffffffffff", | |
2238 | "modified": ["d1/f1"], |
|
2240 | "modified": ["d1/f1"], | |
2239 | "node": "ffffffffffffffffffffffffffffffffffffffff", |
|
2241 | "node": "ffffffffffffffffffffffffffffffffffffffff", | |
2240 | "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"], |
|
2242 | "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"], |
@@ -61,7 +61,7 b' experimental:' | |||||
61 | "date": [0, 0], |
|
61 | "date": [0, 0], | |
62 | "desc": "", |
|
62 | "desc": "", | |
63 | "extra": {"branch": "default"}, |
|
63 | "extra": {"branch": "default"}, | |
64 | "manifest": null, |
|
64 | "manifest": "ffffffffffffffffffffffffffffffffffffffff", | |
65 | "modified": [], |
|
65 | "modified": [], | |
66 | "node": "ffffffffffffffffffffffffffffffffffffffff", |
|
66 | "node": "ffffffffffffffffffffffffffffffffffffffff", | |
67 | "parents": ["95c24699272ef57d062b8bccc32c878bf841784a"], |
|
67 | "parents": ["95c24699272ef57d062b8bccc32c878bf841784a"], | |
@@ -73,11 +73,8 b' experimental:' | |||||
73 | } |
|
73 | } | |
74 | ] |
|
74 | ] | |
75 |
|
75 | |||
76 | Some keywords are invalid for working-directory revision, but they should |
|
|||
77 | never cause crash: |
|
|||
78 |
|
||||
79 | $ hg log -r 'wdir()' -T '{manifest}\n' |
|
76 | $ hg log -r 'wdir()' -T '{manifest}\n' | |
80 |
|
77 | 2147483647:ffffffffffff | ||
81 |
|
78 | |||
82 | Changectx-derived keywords are disabled within {manifest} as {node} changes: |
|
79 | Changectx-derived keywords are disabled within {manifest} as {node} changes: | |
83 |
|
80 |
General Comments 0
You need to be logged in to leave comments.
Login now