Commit 67567d7f authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

python3: enforce byte prefix for vfs.open()

Changeset ea8da5aa23c6 added raw prefix to open(),
but also to vfs.open(). The latter only handles bytestring arguments.
parent e1dc374909bd
...@@ -1057,7 +1057,7 @@ ...@@ -1057,7 +1057,7 @@
if not orig.topic() and repo.vfs.exists('topic'): if not orig.topic() and repo.vfs.exists('topic'):
repo.vfs.unlink('topic') repo.vfs.unlink('topic')
else: else:
with repo.vfs.open(r'topic', r'w') as f: with repo.vfs.open(b'topic', b'w') as f:
f.write(orig.topic()) f.write(orig.topic())
return merge.graft(repo, orig, pctx, ['destination', 'evolving'], True) return merge.graft(repo, orig, pctx, ['destination', 'evolving'], True)
......
...@@ -923,7 +923,7 @@ ...@@ -923,7 +923,7 @@
if newtopic: if newtopic:
with repo.wlock(): with repo.wlock():
with repo.vfs.open(r'topic', r'w') as f: with repo.vfs.open(b'topic', b'w') as f:
f.write(newtopic) f.write(newtopic)
else: else:
if repo.vfs.exists('topic'): if repo.vfs.exists('topic'):
...@@ -1185,7 +1185,7 @@ ...@@ -1185,7 +1185,7 @@
hint = _("see 'hg help -e topic.topic-mode' for details") hint = _("see 'hg help -e topic.topic-mode' for details")
if opts.get('topic'): if opts.get('topic'):
t = opts['topic'] t = opts['topic']
with repo.vfs.open(r'topic', r'w') as f: with repo.vfs.open(b'topic', b'w') as f:
f.write(t) f.write(t)
elif opts.get('amend'): elif opts.get('amend'):
pass pass
...@@ -1197,7 +1197,7 @@ ...@@ -1197,7 +1197,7 @@
if not ui.quiet: if not ui.quiet:
ui.warn(("(%s)\n") % hint) ui.warn(("(%s)\n") % hint)
elif notopic and mayrandom: elif notopic and mayrandom:
with repo.vfs.open(r'topic', r'w') as f: with repo.vfs.open(b'topic', b'w') as f:
f.write(randomname.randomtopicname(ui)) f.write(randomname.randomtopicname(ui))
return orig(ui, repo, *args, **opts) return orig(ui, repo, *args, **opts)
...@@ -1241,7 +1241,7 @@ ...@@ -1241,7 +1241,7 @@
pctx = repo[node] pctx = repo[node]
if pctx.phase() > phases.public: if pctx.phase() > phases.public:
t = pctx.topic() t = pctx.topic()
with repo.vfs.open(r'topic', r'w') as f: with repo.vfs.open(b'topic', b'w') as f:
f.write(t) f.write(t)
if t and t != ot: if t and t != ot:
repo.ui.status(_("switching to topic %s\n") % t) repo.ui.status(_("switching to topic %s\n") % t)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment