Details
Details
- Reviewers
indygreg - Group Reviewers
hg-reviewers - Commits
- rHGce566e0f73d0: py3: use '%d' for integers instead of '%s'
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
indygreg |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/convert/git.py (2 lines) | |||
M | hgext/convert/hg.py (2 lines) | |||
M | hgext/infinitepush/__init__.py (2 lines) | |||
M | mercurial/hg.py (2 lines) |
for l in output: | for l in output: | ||||
if "\t" not in l: | if "\t" not in l: | ||||
continue | continue | ||||
m, f = l[:-1].split("\t") | m, f = l[:-1].split("\t") | ||||
changes.append(f) | changes.append(f) | ||||
else: | else: | ||||
output, status = self.gitrunlines('diff-tree', '--name-only', | output, status = self.gitrunlines('diff-tree', '--name-only', | ||||
'--root', '-r', version, | '--root', '-r', version, | ||||
'%s^%s' % (version, i + 1), '--') | '%s^%d' % (version, i + 1), '--') | ||||
if status: | if status: | ||||
raise error.Abort(_('cannot read changes in %s') % version) | raise error.Abort(_('cannot read changes in %s') % version) | ||||
changes = [f.rstrip('\n') for f in output] | changes = [f.rstrip('\n') for f in output] | ||||
return changes | return changes | ||||
def getbookmarks(self): | def getbookmarks(self): | ||||
bookmarks = {} | bookmarks = {} |
if not newtags: | if not newtags: | ||||
return None, None | return None, None | ||||
data = "".join(newlines) | data = "".join(newlines) | ||||
def getfilectx(repo, memctx, f): | def getfilectx(repo, memctx, f): | ||||
return context.memfilectx(repo, memctx, f, data, False, False, None) | return context.memfilectx(repo, memctx, f, data, False, False, None) | ||||
self.ui.status(_("updating tags\n")) | self.ui.status(_("updating tags\n")) | ||||
date = "%s 0" % int(time.mktime(time.gmtime())) | date = "%d 0" % int(time.mktime(time.gmtime())) | ||||
extra = {'branch': self.tagsbranch} | extra = {'branch': self.tagsbranch} | ||||
ctx = context.memctx(self.repo, (tagparent, None), "update tags", | ctx = context.memctx(self.repo, (tagparent, None), "update tags", | ||||
[".hgtags"], getfilectx, "convert-repo", date, | [".hgtags"], getfilectx, "convert-repo", date, | ||||
extra) | extra) | ||||
node = self.repo.commitctx(ctx) | node = self.repo.commitctx(ctx) | ||||
return nodemod.hex(node), nodemod.hex(tagparent) | return nodemod.hex(node), nodemod.hex(tagparent) | ||||
def setfilemapmode(self, active): | def setfilemapmode(self, active): |
if bookmark and len(bundleheads) > 1: | if bookmark and len(bundleheads) > 1: | ||||
raise error.Abort( | raise error.Abort( | ||||
_('cannot push more than one head to a scratch branch')) | _('cannot push more than one head to a scratch branch')) | ||||
revs = _getrevs(bundle, oldnode, force, bookmark) | revs = _getrevs(bundle, oldnode, force, bookmark) | ||||
# Notify the user of what is being pushed | # Notify the user of what is being pushed | ||||
plural = 's' if len(revs) > 1 else '' | plural = 's' if len(revs) > 1 else '' | ||||
op.repo.ui.warn(_("pushing %s commit%s:\n") % (len(revs), plural)) | op.repo.ui.warn(_("pushing %d commit%s:\n") % (len(revs), plural)) | ||||
maxoutput = 10 | maxoutput = 10 | ||||
for i in range(0, min(len(revs), maxoutput)): | for i in range(0, min(len(revs), maxoutput)): | ||||
firstline = bundle[revs[i]].description().split('\n')[0][:50] | firstline = bundle[revs[i]].description().split('\n')[0][:50] | ||||
op.repo.ui.warn((" %s %s\n") % (revs[i], firstline)) | op.repo.ui.warn((" %s %s\n") % (revs[i], firstline)) | ||||
if len(revs) > maxoutput + 1: | if len(revs) > maxoutput + 1: | ||||
op.repo.ui.warn((" ...\n")) | op.repo.ui.warn((" ...\n")) | ||||
firstline = bundle[revs[-1]].description().split('\n')[0][:50] | firstline = bundle[revs[-1]].description().split('\n')[0][:50] |
for rev in revs: | for rev in revs: | ||||
ctx = repo[rev] | ctx = repo[rev] | ||||
try: | try: | ||||
for subpath in ctx.substate: | for subpath in ctx.substate: | ||||
try: | try: | ||||
ret = (ctx.sub(subpath, allowcreate=False).verify() | ret = (ctx.sub(subpath, allowcreate=False).verify() | ||||
or ret) | or ret) | ||||
except error.RepoError as e: | except error.RepoError as e: | ||||
repo.ui.warn(('%s: %s\n') % (rev, e)) | repo.ui.warn(('%d: %s\n') % (rev, e)) | ||||
except Exception: | except Exception: | ||||
repo.ui.warn(_('.hgsubstate is corrupt in revision %s\n') % | repo.ui.warn(_('.hgsubstate is corrupt in revision %s\n') % | ||||
node.short(ctx.node())) | node.short(ctx.node())) | ||||
return ret | return ret | ||||
def remoteui(src, opts): | def remoteui(src, opts): | ||||
'build a remote ui from ui or repo and opts' | 'build a remote ui from ui or repo and opts' |