##// END OF EJS Templates
debugbackupbundle: migrate `opts` to native kwargs
Matt Harbison -
r51862:b28f794f default
parent child Browse files
Show More
@@ -3734,13 +3734,12 b' def debugbackupbundle(ui, repo, *pats, *'
3734 3734 )
3735 3735 backups.sort(key=lambda x: os.path.getmtime(x), reverse=True)
3736 3736
3737 opts = pycompat.byteskwargs(opts)
3738 opts[b"bundle"] = b""
3739 opts[b"force"] = None
3740 limit = logcmdutil.getlimit(opts)
3737 opts["bundle"] = b""
3738 opts["force"] = None
3739 limit = logcmdutil.getlimit(pycompat.byteskwargs(opts))
3741 3740
3742 3741 def display(other, chlist, displayer):
3743 if opts.get(b"newest_first"):
3742 if opts.get("newest_first"):
3744 3743 chlist.reverse()
3745 3744 count = 0
3746 3745 for n in chlist:
@@ -3749,12 +3748,12 b' def debugbackupbundle(ui, repo, *pats, *'
3749 3748 parents = [
3750 3749 True for p in other.changelog.parents(n) if p != repo.nullid
3751 3750 ]
3752 if opts.get(b"no_merges") and len(parents) == 2:
3751 if opts.get("no_merges") and len(parents) == 2:
3753 3752 continue
3754 3753 count += 1
3755 3754 displayer.show(other[n])
3756 3755
3757 recovernode = opts.get(b"recover")
3756 recovernode = opts.get("recover")
3758 3757 if recovernode:
3759 3758 if scmutil.isrevsymbol(repo, recovernode):
3760 3759 ui.warn(_(b"%s already exists in the repo\n") % recovernode)
@@ -3778,15 +3777,15 b' def debugbackupbundle(ui, repo, *pats, *'
3778 3777 source,
3779 3778 )
3780 3779 try:
3781 other = hg.peer(repo, opts, path)
3780 other = hg.peer(repo, pycompat.byteskwargs(opts), path)
3782 3781 except error.LookupError as ex:
3783 3782 msg = _(b"\nwarning: unable to open bundle %s") % path.loc
3784 3783 hint = _(b"\n(missing parent rev %s)\n") % short(ex.name)
3785 3784 ui.warn(msg, hint=hint)
3786 3785 continue
3787 branches = (path.branch, opts.get(b'branch', []))
3786 branches = (path.branch, opts.get('branch', []))
3788 3787 revs, checkout = hg.addbranchrevs(
3789 repo, other, branches, opts.get(b"rev")
3788 repo, other, branches, opts.get("rev")
3790 3789 )
3791 3790
3792 3791 if revs:
@@ -3795,7 +3794,7 b' def debugbackupbundle(ui, repo, *pats, *'
3795 3794 with ui.silent():
3796 3795 try:
3797 3796 other, chlist, cleanupfn = bundlerepo.getremotechanges(
3798 ui, repo, other, revs, opts[b"bundle"], opts[b"force"]
3797 ui, repo, other, revs, opts["bundle"], opts["force"]
3799 3798 )
3800 3799 except error.LookupError:
3801 3800 continue
@@ -3832,10 +3831,10 b' def debugbackupbundle(ui, repo, *pats, *'
3832 3831 ui.status(b"%s%s\n" % (b"bundle:".ljust(13), path.loc))
3833 3832 else:
3834 3833 opts[
3835 b"template"
3834 "template"
3836 3835 ] = b"{label('status.modified', node|short)} {desc|firstline}\n"
3837 3836 displayer = logcmdutil.changesetdisplayer(
3838 ui, other, opts, False
3837 ui, other, pycompat.byteskwargs(opts), False
3839 3838 )
3840 3839 display(other, chlist, displayer)
3841 3840 displayer.close()
General Comments 0
You need to be logged in to leave comments. Login now