equal
deleted
inserted
replaced
2306 ui.write('\n'.join(sorted(completions))) |
2306 ui.write('\n'.join(sorted(completions))) |
2307 ui.write('\n') |
2307 ui.write('\n') |
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): |
2314 """create arbitrary obsolete marker |
2316 """create arbitrary obsolete marker |
2315 |
2317 |
2340 date = opts.get('date') |
2342 date = opts.get('date') |
2341 if date: |
2343 if date: |
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: |
2350 raise util.Abort(_('bad obsmarker input: %s') % exc) |
2360 raise util.Abort(_('bad obsmarker input: %s') % exc) |
2351 finally: |
2361 finally: |