Show More
@@ -161,6 +161,7 b' from . import (' | |||
|
161 | 161 | phases, |
|
162 | 162 | pushkey, |
|
163 | 163 | pycompat, |
|
164 | scmutil, | |
|
164 | 165 | tags, |
|
165 | 166 | url, |
|
166 | 167 | util, |
@@ -1810,6 +1811,7 b' def handleobsmarker(op, inpart):' | |||
|
1810 | 1811 | if new: |
|
1811 | 1812 | op.repo.ui.status(_('%i new obsolescence markers\n') % new) |
|
1812 | 1813 | op.records.add('obsmarkers', {'new': new}) |
|
1814 | scmutil.registersummarycallback(op.repo, tr) | |
|
1813 | 1815 | if op.reply is not None: |
|
1814 | 1816 | rpart = op.reply.newpart('reply:obsmarkers') |
|
1815 | 1817 | rpart.addparam('in-reply-to', str(inpart.id), mandatory=False) |
@@ -7,6 +7,10 b'' | |||
|
7 | 7 | |
|
8 | 8 | from __future__ import absolute_import |
|
9 | 9 | |
|
10 | from . import ( | |
|
11 | phases, | |
|
12 | ) | |
|
13 | ||
|
10 | 14 | class marker(object): |
|
11 | 15 | """Wrap obsolete marker raw data""" |
|
12 | 16 | |
@@ -285,6 +289,28 b' def foreground(repo, nodes):' | |||
|
285 | 289 | foreground = set(repo.set('%ln::', known)) |
|
286 | 290 | return set(c.node() for c in foreground) |
|
287 | 291 | |
|
292 | def getobsoleted(repo, tr): | |
|
293 | """return the set of pre-existing revisions obsoleted by a transaction""" | |
|
294 | torev = repo.unfiltered().changelog.nodemap.get | |
|
295 | phase = repo._phasecache.phase | |
|
296 | succsmarkers = repo.obsstore.successors.get | |
|
297 | public = phases.public | |
|
298 | addedmarkers = tr.changes.get('obsmarkers') | |
|
299 | addedrevs = tr.changes.get('revs') | |
|
300 | seenrevs = set(addedrevs) | |
|
301 | obsoleted = set() | |
|
302 | for mark in addedmarkers: | |
|
303 | node = mark[0] | |
|
304 | rev = torev(node) | |
|
305 | if rev is None or rev in seenrevs: | |
|
306 | continue | |
|
307 | seenrevs.add(rev) | |
|
308 | if phase(repo, rev) == public: | |
|
309 | continue | |
|
310 | if set(succsmarkers(node)).issubset(addedmarkers): | |
|
311 | obsoleted.add(rev) | |
|
312 | return obsoleted | |
|
313 | ||
|
288 | 314 | def successorssets(repo, initialnode, cache=None): |
|
289 | 315 | """Return set of all latest successors of initial nodes |
|
290 | 316 |
@@ -13,6 +13,7 b' import hashlib' | |||
|
13 | 13 | import os |
|
14 | 14 | import re |
|
15 | 15 | import socket |
|
16 | import weakref | |
|
16 | 17 | |
|
17 | 18 | from .i18n import _ |
|
18 | 19 | from .node import ( |
@@ -22,11 +23,13 b' from .node import (' | |||
|
22 | 23 | wdirrev, |
|
23 | 24 | ) |
|
24 | 25 | |
|
26 | from .i18n import _ | |
|
25 | 27 | from . import ( |
|
26 | 28 | encoding, |
|
27 | 29 | error, |
|
28 | 30 | match as matchmod, |
|
29 | 31 | obsolete, |
|
32 | obsutil, | |
|
30 | 33 | pathutil, |
|
31 | 34 | phases, |
|
32 | 35 | pycompat, |
@@ -1059,3 +1062,15 b' class simplekeyvaluefile(object):' | |||
|
1059 | 1062 | lines.append("%s=%s\n" % (k, v)) |
|
1060 | 1063 | with self.vfs(self.path, mode='wb', atomictemp=True) as fp: |
|
1061 | 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) |
@@ -484,6 +484,7 b' Update to a successor works' | |||
|
484 | 484 | remote: adding file changes |
|
485 | 485 | remote: added 2 changesets with 2 changes to 1 files (+1 heads) |
|
486 | 486 | remote: 2 new obsolescence markers |
|
487 | remote: obsoleted 1 changesets | |
|
487 | 488 | updating bookmark Y |
|
488 | 489 | $ hg -R ../a book |
|
489 | 490 | @ 1:0d2164f0ce0d |
@@ -212,6 +212,7 b' test obsmarkers exchange.' | |||
|
212 | 212 | remote: adding file changes |
|
213 | 213 | remote: added 1 changesets with 1 changes to 1 files (+1 heads) |
|
214 | 214 | remote: 1 new obsolescence markers |
|
215 | remote: obsoleted 1 changesets | |
|
215 | 216 | ## post push state |
|
216 | 217 | # obstore: main |
|
217 | 218 | 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
@@ -227,6 +228,7 b' test obsmarkers exchange.' | |||
|
227 | 228 | adding file changes |
|
228 | 229 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
229 | 230 | 1 new obsolescence markers |
|
231 | obsoleted 1 changesets | |
|
230 | 232 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
231 | 233 | ## post pull state |
|
232 | 234 | # obstore: main |
@@ -97,6 +97,7 b' Actual Test (explicit push version)' | |||
|
97 | 97 | searching for changes |
|
98 | 98 | no changes found |
|
99 | 99 | remote: 1 new obsolescence markers |
|
100 | remote: obsoleted 1 changesets | |
|
100 | 101 | ## post push state |
|
101 | 102 | # obstore: main |
|
102 | 103 | 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
@@ -107,6 +108,7 b' Actual Test (explicit push version)' | |||
|
107 | 108 | pulling from main |
|
108 | 109 | no changes found |
|
109 | 110 | 1 new obsolescence markers |
|
111 | obsoleted 1 changesets | |
|
110 | 112 | ## post pull state |
|
111 | 113 | # obstore: main |
|
112 | 114 | 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
@@ -130,6 +132,7 b' Actual Test (bare push version)' | |||
|
130 | 132 | searching for changes |
|
131 | 133 | no changes found |
|
132 | 134 | remote: 1 new obsolescence markers |
|
135 | remote: obsoleted 1 changesets | |
|
133 | 136 | ## post push state |
|
134 | 137 | # obstore: main |
|
135 | 138 | 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
@@ -141,6 +144,7 b' Actual Test (bare push version)' | |||
|
141 | 144 | searching for changes |
|
142 | 145 | no changes found |
|
143 | 146 | 1 new obsolescence markers |
|
147 | obsoleted 1 changesets | |
|
144 | 148 | ## post pull state |
|
145 | 149 | # obstore: main |
|
146 | 150 | 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
@@ -735,6 +735,7 b' Test setup' | |||
|
735 | 735 | adding file changes |
|
736 | 736 | added 1 changesets with 0 changes to 1 files (+1 heads) |
|
737 | 737 | 2 new obsolescence markers |
|
738 | obsoleted 1 changesets | |
|
738 | 739 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
739 | 740 | $ hg log --hidden -G |
|
740 | 741 | o changeset: 2:7a230b46bf61 |
@@ -205,6 +205,7 b' Actual testing' | |||
|
205 | 205 | # unbundling: adding file changes |
|
206 | 206 | # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) |
|
207 | 207 | # unbundling: 2 new obsolescence markers |
|
208 | # unbundling: obsoleted 1 changesets | |
|
208 | 209 | # unbundling: (run 'hg heads' to see heads) |
|
209 | 210 | |
|
210 | 211 | $ testrevs 'desc("C-A")' |
@@ -366,6 +367,7 b' problematic)' | |||
|
366 | 367 | # unbundling: adding file changes |
|
367 | 368 | # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) |
|
368 | 369 | # unbundling: 1 new obsolescence markers |
|
370 | # unbundling: obsoleted 1 changesets | |
|
369 | 371 | # unbundling: (run 'hg heads' to see heads) |
|
370 | 372 | |
|
371 | 373 | bundling multiple revisions |
@@ -957,6 +959,7 b' Actual testing' | |||
|
957 | 959 | # unbundling: adding file changes |
|
958 | 960 | # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) |
|
959 | 961 | # unbundling: 6 new obsolescence markers |
|
962 | # unbundling: obsoleted 3 changesets | |
|
960 | 963 | # unbundling: (run 'hg heads' to see heads) |
|
961 | 964 | |
|
962 | 965 | Bundle multiple revisions |
@@ -1057,6 +1060,7 b' Bundle multiple revisions' | |||
|
1057 | 1060 | # unbundling: adding file changes |
|
1058 | 1061 | # unbundling: added 2 changesets with 2 changes to 2 files (+2 heads) |
|
1059 | 1062 | # unbundling: 7 new obsolescence markers |
|
1063 | # unbundling: obsoleted 2 changesets | |
|
1060 | 1064 | # unbundling: (run 'hg heads' to see heads) |
|
1061 | 1065 | |
|
1062 | 1066 | * top one and initial precursors |
@@ -1122,6 +1126,7 b' Bundle multiple revisions' | |||
|
1122 | 1126 | # unbundling: adding file changes |
|
1123 | 1127 | # unbundling: added 2 changesets with 2 changes to 2 files (+2 heads) |
|
1124 | 1128 | # unbundling: 6 new obsolescence markers |
|
1129 | # unbundling: obsoleted 3 changesets | |
|
1125 | 1130 | # unbundling: (run 'hg heads' to see heads) |
|
1126 | 1131 | |
|
1127 | 1132 | * top one and one of the split |
@@ -1189,6 +1194,7 b' Bundle multiple revisions' | |||
|
1189 | 1194 | # unbundling: adding file changes |
|
1190 | 1195 | # unbundling: added 2 changesets with 2 changes to 2 files (+2 heads) |
|
1191 | 1196 | # unbundling: 7 new obsolescence markers |
|
1197 | # unbundling: obsoleted 2 changesets | |
|
1192 | 1198 | # unbundling: (run 'hg heads' to see heads) |
|
1193 | 1199 | |
|
1194 | 1200 | * all |
@@ -613,6 +613,7 b' Do not warn about new head when the new ' | |||
|
613 | 613 | adding file changes |
|
614 | 614 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
615 | 615 | 1 new obsolescence markers |
|
616 | obsoleted 1 changesets | |
|
616 | 617 | |
|
617 | 618 | test relevance computation |
|
618 | 619 | --------------------------------------- |
@@ -68,5 +68,6 b' Actual testing' | |||
|
68 | 68 | adding file changes |
|
69 | 69 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
70 | 70 | 1 new obsolescence markers |
|
71 | obsoleted 1 changesets | |
|
71 | 72 | |
|
72 | 73 | $ cd ../.. |
@@ -81,5 +81,6 b' Actual testing' | |||
|
81 | 81 | adding file changes |
|
82 | 82 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
83 | 83 | 2 new obsolescence markers |
|
84 | obsoleted 2 changesets | |
|
84 | 85 | |
|
85 | 86 | $ cd ../.. |
@@ -81,6 +81,7 b' Actual testing' | |||
|
81 | 81 | adding file changes |
|
82 | 82 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
83 | 83 | 2 new obsolescence markers |
|
84 | obsoleted 2 changesets | |
|
84 | 85 | |
|
85 | 86 | $ cd ../.. |
|
86 | 87 |
@@ -82,5 +82,6 b' Actual testing' | |||
|
82 | 82 | adding file changes |
|
83 | 83 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
84 | 84 | 2 new obsolescence markers |
|
85 | obsoleted 2 changesets | |
|
85 | 86 | |
|
86 | 87 | $ cd ../.. |
@@ -88,5 +88,6 b' Actual testing' | |||
|
88 | 88 | adding file changes |
|
89 | 89 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
90 | 90 | 3 new obsolescence markers |
|
91 | obsoleted 3 changesets | |
|
91 | 92 | |
|
92 | 93 | $ cd ../.. |
@@ -74,5 +74,6 b' Actual testing' | |||
|
74 | 74 | adding file changes |
|
75 | 75 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
76 | 76 | 2 new obsolescence markers |
|
77 | obsoleted 1 changesets | |
|
77 | 78 | |
|
78 | 79 | $ cd ../.. |
@@ -73,5 +73,6 b' Actual testing' | |||
|
73 | 73 | adding file changes |
|
74 | 74 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
75 | 75 | 2 new obsolescence markers |
|
76 | obsoleted 1 changesets | |
|
76 | 77 | |
|
77 | 78 | $ cd ../.. |
@@ -94,5 +94,6 b' Actual testing' | |||
|
94 | 94 | adding file changes |
|
95 | 95 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
96 | 96 | 4 new obsolescence markers |
|
97 | obsoleted 2 changesets | |
|
97 | 98 | |
|
98 | 99 | $ cd ../.. |
@@ -65,5 +65,6 b' Actual testing' | |||
|
65 | 65 | adding file changes |
|
66 | 66 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
67 | 67 | 1 new obsolescence markers |
|
68 | obsoleted 1 changesets | |
|
68 | 69 | |
|
69 | 70 | $ cd ../.. |
@@ -83,5 +83,6 b' Actual testing' | |||
|
83 | 83 | adding file changes |
|
84 | 84 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
85 | 85 | 2 new obsolescence markers |
|
86 | obsoleted 2 changesets | |
|
86 | 87 | |
|
87 | 88 | $ cd ../.. |
@@ -86,5 +86,6 b' Actual testing' | |||
|
86 | 86 | adding file changes |
|
87 | 87 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
88 | 88 | 2 new obsolescence markers |
|
89 | obsoleted 2 changesets | |
|
89 | 90 | |
|
90 | 91 | $ cd ../.. |
@@ -70,5 +70,6 b' Actual testing' | |||
|
70 | 70 | adding file changes |
|
71 | 71 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
72 | 72 | 1 new obsolescence markers |
|
73 | obsoleted 1 changesets | |
|
73 | 74 | |
|
74 | 75 | $ cd ../../ |
@@ -70,6 +70,7 b' Actual testing' | |||
|
70 | 70 | adding file changes |
|
71 | 71 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
72 | 72 | 1 new obsolescence markers |
|
73 | obsoleted 1 changesets | |
|
73 | 74 | |
|
74 | 75 | $ cd ../.. |
|
75 | 76 |
@@ -94,5 +94,6 b' Actual testing' | |||
|
94 | 94 | adding file changes |
|
95 | 95 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
96 | 96 | 2 new obsolescence markers |
|
97 | obsoleted 2 changesets | |
|
97 | 98 | |
|
98 | 99 | $ cd ../.. |
@@ -94,5 +94,6 b' Actual testing' | |||
|
94 | 94 | adding file changes |
|
95 | 95 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
96 | 96 | 2 new obsolescence markers |
|
97 | obsoleted 2 changesets | |
|
97 | 98 | |
|
98 | 99 | $ cd ../.. |
@@ -75,5 +75,6 b' Actual testing' | |||
|
75 | 75 | adding file changes |
|
76 | 76 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
77 | 77 | 2 new obsolescence markers |
|
78 | obsoleted 1 changesets | |
|
78 | 79 | |
|
79 | 80 | $ cd ../.. |
@@ -118,5 +118,6 b' Actual testing (existing branch only)' | |||
|
118 | 118 | adding file changes |
|
119 | 119 | added 1 changesets with 1 changes to 1 files |
|
120 | 120 | 1 new obsolescence markers |
|
121 | obsoleted 1 changesets | |
|
121 | 122 | |
|
122 | 123 | $ cd ../.. |
@@ -103,5 +103,6 b' Actual testing' | |||
|
103 | 103 | adding file changes |
|
104 | 104 | added 1 changesets with 1 changes to 1 files |
|
105 | 105 | 1 new obsolescence markers |
|
106 | obsoleted 1 changesets | |
|
106 | 107 | |
|
107 | 108 | $ cd ../.. |
@@ -92,5 +92,6 b' Actual testing' | |||
|
92 | 92 | adding file changes |
|
93 | 93 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
94 | 94 | 3 new obsolescence markers |
|
95 | obsoleted 1 changesets | |
|
95 | 96 | |
|
96 | 97 | $ cd ../.. |
@@ -1665,6 +1665,7 b' racing commit push a new head obsoleting' | |||
|
1665 | 1665 | adding file changes |
|
1666 | 1666 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
1667 | 1667 | 1 new obsolescence markers |
|
1668 | obsoleted 1 changesets | |
|
1668 | 1669 | (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
1669 | 1670 | $ hg -R ./client-other pull |
|
1670 | 1671 | pulling from ssh://user@dummy/server |
@@ -1674,6 +1675,7 b' racing commit push a new head obsoleting' | |||
|
1674 | 1675 | adding file changes |
|
1675 | 1676 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
1676 | 1677 | 1 new obsolescence markers |
|
1678 | obsoleted 1 changesets | |
|
1677 | 1679 | (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
1678 | 1680 | $ hg -R ./client-racy pull |
|
1679 | 1681 | pulling from ssh://user@dummy/server |
@@ -1770,6 +1772,7 b' Pushing' | |||
|
1770 | 1772 | remote: adding file changes |
|
1771 | 1773 | remote: added 1 changesets with 0 changes to 1 files (+1 heads) |
|
1772 | 1774 | remote: 1 new obsolescence markers |
|
1775 | remote: obsoleted 1 changesets | |
|
1773 | 1776 | |
|
1774 | 1777 | $ release $TESTTMP/watchfile |
|
1775 | 1778 |
General Comments 0
You need to be logged in to leave comments.
Login now