##// END OF EJS Templates
debugobsolete: list all obsolete marker if no argument are specified
Pierre-Yves.David@ens-lyon.org -
r17074:178a2e85 default
parent child Browse files
Show More
@@ -17,7 +17,7 b' import merge as mergemod'
17 import minirst, revset, fileset
17 import minirst, revset, fileset
18 import dagparser, context, simplemerge
18 import dagparser, context, simplemerge
19 import random, setdiscovery, treediscovery, dagutil, pvec
19 import random, setdiscovery, treediscovery, dagutil, pvec
20 import phases
20 import phases, obsolete
21
21
22 table = {}
22 table = {}
23
23
@@ -2050,19 +2050,29 b' def debugknown(ui, repopath, *ids, **opt'
2050 ui.write("%s\n" % ("".join([f and "1" or "0" for f in flags])))
2050 ui.write("%s\n" % ("".join([f and "1" or "0" for f in flags])))
2051
2051
2052 @command('debugobsolete', [] + commitopts2,
2052 @command('debugobsolete', [] + commitopts2,
2053 _('OBSOLETED [REPLACEMENT] [REPL...'))
2053 _('[OBSOLETED [REPLACEMENT] [REPL... ]'))
2054 def debugobsolete(ui, repo, precursor, *successors, **opts):
2054 def debugobsolete(ui, repo, precursor=None, *successors, **opts):
2055 """create arbitrary obsolete marker"""
2055 """create arbitrary obsolete marker"""
2056 metadata = {}
2056 if precursor is not None:
2057 if 'date' in opts:
2057 metadata = {}
2058 metadata['date'] = opts['date']
2058 if 'date' in opts:
2059 metadata['user'] = opts['user'] or ui.username()
2059 metadata['date'] = opts['date']
2060 succs = tuple(bin(succ) for succ in successors)
2060 metadata['user'] = opts['user'] or ui.username()
2061 l = repo.lock()
2061 succs = tuple(bin(succ) for succ in successors)
2062 try:
2062 l = repo.lock()
2063 repo.obsstore.create(bin(precursor), succs, 0, metadata)
2063 try:
2064 finally:
2064 repo.obsstore.create(bin(precursor), succs, 0, metadata)
2065 l.release()
2065 finally:
2066 l.release()
2067 else:
2068 for mctx in obsolete.allmarkers(repo):
2069 ui.write(hex(mctx.precnode()))
2070 for repl in mctx.succnodes():
2071 ui.write(' ')
2072 ui.write(hex(repl))
2073 ui.write(' %X ' % mctx._data[2])
2074 ui.write(mctx.metadata())
2075 ui.write('\n')
2066
2076
2067 @command('debugpushkey', [], _('REPO NAMESPACE [KEY OLD NEW]'))
2077 @command('debugpushkey', [], _('REPO NAMESPACE [KEY OLD NEW]'))
2068 def debugpushkey(ui, repopath, namespace, *keyinfo, **opts):
2078 def debugpushkey(ui, repopath, namespace, *keyinfo, **opts):
@@ -16,6 +16,8 b' Killing a single changeset without repla'
16
16
17 $ mkcommit kill_me
17 $ mkcommit kill_me
18 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
18 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
19 $ hg debugobsolete
20 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 {'date': '0 0', 'user': 'babar'}
19 $ cd ..
21 $ cd ..
20
22
21 Killing a single changeset with replacement
23 Killing a single changeset with replacement
@@ -30,6 +32,8 b' Killing a single changeset with replacem'
30 $ mkcommit new_c
32 $ mkcommit new_c
31 created new head
33 created new head
32 $ hg debugobsolete `getid original_c` `getid new_c` -d '56 12'
34 $ hg debugobsolete `getid original_c` `getid new_c` -d '56 12'
35 $ hg debugobsolete
36 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
33
37
34 do it again (it read the obsstore before adding new changeset)
38 do it again (it read the obsstore before adding new changeset)
35
39
@@ -38,6 +42,9 b' do it again (it read the obsstore before'
38 $ mkcommit new_2_c
42 $ mkcommit new_2_c
39 created new head
43 created new head
40 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
44 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
45 $ hg debugobsolete
46 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
47 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
41
48
42 Register two markers with a missing node
49 Register two markers with a missing node
43
50
@@ -47,3 +54,8 b' Register two markers with a missing node'
47 created new head
54 created new head
48 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
55 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
49 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
56 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
57 $ hg debugobsolete
58 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
59 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
60 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
61 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
General Comments 0
You need to be logged in to leave comments. Login now