##// END OF EJS Templates
debugobsolete: add a way to record parent information...
Pierre-Yves David -
r22272:406181ee default
parent child Browse files
Show More
@@ -2308,6 +2308,8 b' def debuglabelcomplete(ui, repo, *args):'
2308
2308
2309 @command('debugobsolete',
2309 @command('debugobsolete',
2310 [('', 'flags', 0, _('markers flag')),
2310 [('', 'flags', 0, _('markers flag')),
2311 ('', 'record-parents', False,
2312 _('record parent information for the precursor')),
2311 ] + commitopts2,
2313 ] + commitopts2,
2312 _('[OBSOLETED [REPLACEMENT] [REPL... ]'))
2314 _('[OBSOLETED [REPLACEMENT] [REPL... ]'))
2313 def debugobsolete(ui, repo, precursor=None, *successors, **opts):
2315 def debugobsolete(ui, repo, precursor=None, *successors, **opts):
@@ -2342,8 +2344,16 b' def debugobsolete(ui, repo, precursor=No'
2342 date = util.parsedate(date)
2344 date = util.parsedate(date)
2343 else:
2345 else:
2344 date = None
2346 date = None
2345 repo.obsstore.create(tr, parsenodeid(precursor), succs,
2347 prec = parsenodeid(precursor)
2346 opts['flags'], date=date,
2348 parents = None
2349 if opts['record_parents']:
2350 if prec not in repo.unfiltered():
2351 raise util.Abort('cannot used --record-parents on '
2352 'unknown changesets')
2353 parents = repo.unfiltered()[prec].parents()
2354 parents = tuple(p.node() for p in parents)
2355 repo.obsstore.create(tr, prec, succs, opts['flags'],
2356 parents=parents, date=date,
2347 metadata=metadata)
2357 metadata=metadata)
2348 tr.close()
2358 tr.close()
2349 except ValueError, exc:
2359 except ValueError, exc:
@@ -244,7 +244,7 b' Show all commands + options'
244 debuginstall:
244 debuginstall:
245 debugknown:
245 debugknown:
246 debuglabelcomplete:
246 debuglabelcomplete:
247 debugobsolete: flags, date, user
247 debugobsolete: flags, record-parents, date, user
248 debugpathcomplete: full, normal, added, removed
248 debugpathcomplete: full, normal, added, removed
249 debugpushkey:
249 debugpushkey:
250 debugpvec:
250 debugpvec:
@@ -417,7 +417,9 b' detect outgoing obsolete and unstable'
417 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
417 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
418 $ mkcommit original_d
418 $ mkcommit original_d
419 $ mkcommit original_e
419 $ mkcommit original_e
420 $ hg debugobsolete `getid original_d` -d '0 0'
420 $ hg debugobsolete --record-parents `getid original_d` -d '0 0'
421 $ hg debugobsolete | grep `getid original_d`
422 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
421 $ hg log -r 'obsolete()'
423 $ hg log -r 'obsolete()'
422 4:94b33453f93b (draft) [ ] add original_d
424 4:94b33453f93b (draft) [ ] add original_d
423 $ hg log -G -r '::unstable()'
425 $ hg log -G -r '::unstable()'
General Comments 0
You need to be logged in to leave comments. Login now