Show More
@@ -1356,7 +1356,7 b' def debugobsolete(ui, repo, precursor=No' | |||
|
1356 | 1356 | parents = tuple(p.node() for p in parents) |
|
1357 | 1357 | repo.obsstore.create(tr, prec, succs, opts['flags'], |
|
1358 | 1358 | parents=parents, date=date, |
|
1359 | metadata=metadata) | |
|
1359 | metadata=metadata, ui=ui) | |
|
1360 | 1360 | tr.close() |
|
1361 | 1361 | except ValueError as exc: |
|
1362 | 1362 | raise error.Abort(_('bad obsmarker input: %s') % exc) |
@@ -584,7 +584,7 b' class obsstore(object):' | |||
|
584 | 584 | return self._readonly |
|
585 | 585 | |
|
586 | 586 | def create(self, transaction, prec, succs=(), flag=0, parents=None, |
|
587 | date=None, metadata=None): | |
|
587 | date=None, metadata=None, ui=None): | |
|
588 | 588 | """obsolete: add a new obsolete marker |
|
589 | 589 | |
|
590 | 590 | * ensuring it is hashable |
@@ -603,6 +603,10 b' class obsstore(object):' | |||
|
603 | 603 | if 'date' in metadata: |
|
604 | 604 | # as a courtesy for out-of-tree extensions |
|
605 | 605 | date = util.parsedate(metadata.pop('date')) |
|
606 | elif ui is not None: | |
|
607 | date = ui.configdate('devel', 'default-date') | |
|
608 | if date is None: | |
|
609 | date = util.makedate() | |
|
606 | 610 | else: |
|
607 | 611 | date = util.makedate() |
|
608 | 612 | if len(prec) != 20: |
@@ -1286,7 +1290,8 b' def createmarkers(repo, relations, flag=' | |||
|
1286 | 1290 | for args in markerargs: |
|
1287 | 1291 | nprec, nsucs, npare, localmetadata = args |
|
1288 | 1292 | repo.obsstore.create(tr, nprec, nsucs, flag, parents=npare, |
|
1289 |
date=date, metadata=localmetadata |
|
|
1293 | date=date, metadata=localmetadata, | |
|
1294 | ui=repo.ui) | |
|
1290 | 1295 | repo.filteredrevcache.clear() |
|
1291 | 1296 | tr.close() |
|
1292 | 1297 | finally: |
@@ -1252,7 +1252,7 b' only a subset of those are displayed (be' | |||
|
1252 | 1252 | $ hg debugobsolete --index --rev "3+7" -Tjson |
|
1253 | 1253 | [ |
|
1254 | 1254 | { |
|
1255 |
"date": |
|
|
1255 | "date": [0.0, 0], | |
|
1256 | 1256 | "flag": 0, |
|
1257 | 1257 | "index": 1, |
|
1258 | 1258 | "metadata": {"user": "test"}, |
@@ -1260,7 +1260,7 b' only a subset of those are displayed (be' | |||
|
1260 | 1260 | "succnodes": ["d27fb9b066076fd921277a4b9e8b9cb48c95bc6a"] |
|
1261 | 1261 | }, |
|
1262 | 1262 | { |
|
1263 |
"date": |
|
|
1263 | "date": [0.0, 0], | |
|
1264 | 1264 | "flag": 0, |
|
1265 | 1265 | "index": 3, |
|
1266 | 1266 | "metadata": {"operation": "amend", "user": "test"}, |
@@ -1271,15 +1271,15 b' only a subset of those are displayed (be' | |||
|
1271 | 1271 | |
|
1272 | 1272 | Test the --delete option of debugobsolete command |
|
1273 | 1273 | $ hg debugobsolete --index |
|
1274 |
0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 |
|
|
1275 |
1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 |
|
|
1276 |
2 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 |
|
|
1277 |
3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 ( |
|
|
1274 | 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
1275 | 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
1276 | 2 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
1277 | 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} | |
|
1278 | 1278 | $ hg debugobsolete --delete 1 --delete 3 |
|
1279 | 1279 | deleted 2 obsolescence markers |
|
1280 | 1280 | $ hg debugobsolete |
|
1281 |
cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 |
|
|
1282 |
1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 |
|
|
1281 | cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
1282 | 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
|
1283 | 1283 | |
|
1284 | 1284 | Test adding changeset after obsmarkers affecting it |
|
1285 | 1285 | (eg: during pull, or unbundle) |
General Comments 0
You need to be logged in to leave comments.
Login now