equal
deleted
inserted
replaced
11 import glob |
11 import glob |
12 import hashlib |
12 import hashlib |
13 import os |
13 import os |
14 import re |
14 import re |
15 import socket |
15 import socket |
|
16 import weakref |
16 |
17 |
17 from .i18n import _ |
18 from .i18n import _ |
18 from .node import ( |
19 from .node import ( |
19 hex, |
20 hex, |
20 nullid, |
21 nullid, |
21 wdirid, |
22 wdirid, |
22 wdirrev, |
23 wdirrev, |
23 ) |
24 ) |
24 |
25 |
|
26 from .i18n import _ |
25 from . import ( |
27 from . import ( |
26 encoding, |
28 encoding, |
27 error, |
29 error, |
28 match as matchmod, |
30 match as matchmod, |
29 obsolete, |
31 obsolete, |
|
32 obsutil, |
30 pathutil, |
33 pathutil, |
31 phases, |
34 phases, |
32 pycompat, |
35 pycompat, |
33 revsetlang, |
36 revsetlang, |
34 similar, |
37 similar, |
1057 e = "invalid value in a simple key-value file" |
1060 e = "invalid value in a simple key-value file" |
1058 raise error.ProgrammingError(e) |
1061 raise error.ProgrammingError(e) |
1059 lines.append("%s=%s\n" % (k, v)) |
1062 lines.append("%s=%s\n" % (k, v)) |
1060 with self.vfs(self.path, mode='wb', atomictemp=True) as fp: |
1063 with self.vfs(self.path, mode='wb', atomictemp=True) as fp: |
1061 fp.write(''.join(lines)) |
1064 fp.write(''.join(lines)) |
|
1065 |
|
1066 def registersummarycallback(repo, otr): |
|
1067 """register a callback to issue a summary after the transaction is closed |
|
1068 """ |
|
1069 reporef = weakref.ref(repo) |
|
1070 def reportsummary(tr): |
|
1071 """the actual callback reporting the summary""" |
|
1072 repo = reporef() |
|
1073 obsoleted = obsutil.getobsoleted(repo, tr) |
|
1074 if obsoleted: |
|
1075 repo.ui.status(_('obsoleted %i changesets\n') % len(obsoleted)) |
|
1076 otr.addpostclose('00-txnreport', reportsummary) |