Commits

Yuya Nishihara  committed 28b1fab

copypatch: have dummy Writable object acts like a string (fixes #2280)

Since Mercurial 2.4, output (=template) parameter must be string [1].
We can simply pass output='' for 2.4, but Mercurial 2.3 still requires
dummy file-like object.
As a workaround, this implements len(writable), so that it can bypass
`len(template) > 0` of cmdutil.export().

I'll write another patch for default branch, which should take away dummy
Writable hack.

[1]: http://www.selenic.com/repo/hg/rev/a306837f8c87

  • Participants
  • Parent commits 22ada7f
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/repowidget.py

                 class Writable(object):
                     def write(self, *args, **opts): _ui.write(*args, **opts)
                     def close(self): pass
+                    def __len__(self): return 0
                 commands.export(_ui, self.repo, self.rev, output=Writable())
             else:
                 revs = self.rev and self.menuselection or None