Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGfce1c17493db: debugbuilddag: use progress helper
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/debugcommands.py (8 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Martin von Zweigbergk | Jun 18 2018, 12:44 AM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
linesperrev = 2 | linesperrev = 2 | ||||
# make a file with k lines per rev | # make a file with k lines per rev | ||||
initialmergedlines = ['%d' % i for i in xrange(0, total * linesperrev)] | initialmergedlines = ['%d' % i for i in xrange(0, total * linesperrev)] | ||||
initialmergedlines.append("") | initialmergedlines.append("") | ||||
tags = [] | tags = [] | ||||
wlock = lock = tr = None | wlock = lock = tr = None | ||||
progress = ui.makeprogress(_('building'), unit=_('revisions'), | |||||
total=total) | |||||
try: | try: | ||||
wlock = repo.wlock() | wlock = repo.wlock() | ||||
lock = repo.lock() | lock = repo.lock() | ||||
tr = repo.transaction("builddag") | tr = repo.transaction("builddag") | ||||
at = -1 | at = -1 | ||||
atbranch = 'default' | atbranch = 'default' | ||||
nodeids = [] | nodeids = [] | ||||
id = 0 | id = 0 | ||||
ui.progress(_('building'), id, unit=_('revisions'), total=total) | progress.update(id) | ||||
for type, data in dagparser.parsedag(text): | for type, data in dagparser.parsedag(text): | ||||
if type == 'n': | if type == 'n': | ||||
ui.note(('node %s\n' % pycompat.bytestr(data))) | ui.note(('node %s\n' % pycompat.bytestr(data))) | ||||
id, ps = data | id, ps = data | ||||
files = [] | files = [] | ||||
filecontent = {} | filecontent = {} | ||||
at = id | at = id | ||||
elif type == 'l': | elif type == 'l': | ||||
id, name = data | id, name = data | ||||
ui.note(('tag %s\n' % name)) | ui.note(('tag %s\n' % name)) | ||||
tags.append("%s %s\n" % (hex(repo.changelog.node(id)), name)) | tags.append("%s %s\n" % (hex(repo.changelog.node(id)), name)) | ||||
elif type == 'a': | elif type == 'a': | ||||
ui.note(('branch %s\n' % data)) | ui.note(('branch %s\n' % data)) | ||||
atbranch = data | atbranch = data | ||||
ui.progress(_('building'), id, unit=_('revisions'), total=total) | progress.update(id) | ||||
tr.close() | tr.close() | ||||
if tags: | if tags: | ||||
repo.vfs.write("localtags", "".join(tags)) | repo.vfs.write("localtags", "".join(tags)) | ||||
finally: | finally: | ||||
ui.progress(_('building'), None) | progress.complete() | ||||
release(tr, lock, wlock) | release(tr, lock, wlock) | ||||
def _debugchangegroup(ui, gen, all=None, indent=0, **opts): | def _debugchangegroup(ui, gen, all=None, indent=0, **opts): | ||||
indent_string = ' ' * indent | indent_string = ' ' * indent | ||||
if all: | if all: | ||||
ui.write(("%sformat: id, p1, p2, cset, delta base, len(delta)\n") | ui.write(("%sformat: id, p1, p2, cset, delta base, len(delta)\n") | ||||
% indent_string) | % indent_string) | ||||