Show More
@@ -3707,20 +3707,19 def debugbackupbundle(ui, repo, *pats, * | |||
|
3707 | 3707 | for backup in backups: |
|
3708 | 3708 | # Much of this is copied from the hg incoming logic |
|
3709 | 3709 | source = os.path.relpath(backup, encoding.getcwd()) |
|
3710 |
|
|
|
3710 | path = urlutil.get_unique_pull_path_obj( | |
|
3711 | 3711 | b'debugbackupbundle', |
|
3712 | repo, | |
|
3713 | 3712 | ui, |
|
3714 | 3713 | source, |
|
3715 | default_branches=opts.get(b'branch'), | |
|
3716 | 3714 | ) |
|
3717 | 3715 | try: |
|
3718 |
other = hg.peer(repo, opts, |
|
|
3716 | other = hg.peer(repo, opts, path) | |
|
3719 | 3717 | except error.LookupError as ex: |
|
3720 |
msg = _(b"\nwarning: unable to open bundle %s") % |
|
|
3718 | msg = _(b"\nwarning: unable to open bundle %s") % path.loc | |
|
3721 | 3719 | hint = _(b"\n(missing parent rev %s)\n") % short(ex.name) |
|
3722 | 3720 | ui.warn(msg, hint=hint) |
|
3723 | 3721 | continue |
|
3722 | branches = (path.branch, opts.get(b'branch', [])) | |
|
3724 | 3723 | revs, checkout = hg.addbranchrevs( |
|
3725 | 3724 | repo, other, branches, opts.get(b"rev") |
|
3726 | 3725 | ) |
@@ -3743,29 +3742,29 def debugbackupbundle(ui, repo, *pats, * | |||
|
3743 | 3742 | with repo.lock(), repo.transaction(b"unbundle") as tr: |
|
3744 | 3743 | if scmutil.isrevsymbol(other, recovernode): |
|
3745 | 3744 | ui.status(_(b"Unbundling %s\n") % (recovernode)) |
|
3746 |
f = hg.openpath(ui, |
|
|
3747 |
gen = exchange.readbundle(ui, f, |
|
|
3745 | f = hg.openpath(ui, path.loc) | |
|
3746 | gen = exchange.readbundle(ui, f, path.loc) | |
|
3748 | 3747 | if isinstance(gen, bundle2.unbundle20): |
|
3749 | 3748 | bundle2.applybundle( |
|
3750 | 3749 | repo, |
|
3751 | 3750 | gen, |
|
3752 | 3751 | tr, |
|
3753 | 3752 | source=b"unbundle", |
|
3754 |
url=b"bundle:" + |
|
|
3753 | url=b"bundle:" + path.loc, | |
|
3755 | 3754 | ) |
|
3756 | 3755 | else: |
|
3757 |
gen.apply(repo, b"unbundle", b"bundle:" + |
|
|
3756 | gen.apply(repo, b"unbundle", b"bundle:" + path.loc) | |
|
3758 | 3757 | break |
|
3759 | 3758 | else: |
|
3760 | 3759 | backupdate = encoding.strtolocal( |
|
3761 | 3760 | time.strftime( |
|
3762 | 3761 | "%a %H:%M, %Y-%m-%d", |
|
3763 |
time.localtime(os.path.getmtime( |
|
|
3762 | time.localtime(os.path.getmtime(path.loc)), | |
|
3764 | 3763 | ) |
|
3765 | 3764 | ) |
|
3766 | 3765 | ui.status(b"\n%s\n" % (backupdate.ljust(50))) |
|
3767 | 3766 | if ui.verbose: |
|
3768 |
ui.status(b"%s%s\n" % (b"bundle:".ljust(13), |
|
|
3767 | ui.status(b"%s%s\n" % (b"bundle:".ljust(13), path.loc)) | |
|
3769 | 3768 | else: |
|
3770 | 3769 | opts[ |
|
3771 | 3770 | b"template" |
General Comments 0
You need to be logged in to leave comments.
Login now