D2172: py3: convert FrameInfo members to bytes

2018-02-12 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG20dbe0eee139: py3: convert FrameInfo members to bytes 
(authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2172?vs=5473=5595

REVISION DETAIL
  https://phab.mercurial-scm.org/D2172

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1622,12 +1622,12 @@
 calframe = inspect.getouterframes(curframe, 2)
 frameinfo = calframe[stacklevel]
 
-self.write_err('%s at: %s:%s (%s)\n' % (
-msg, frameinfo.filename, frameinfo.lineno,
-frameinfo.function))
-self.log('develwarn', '%s at: %s:%s (%s)\n',
- msg, frameinfo.filename, frameinfo.lineno,
- frameinfo.function)
+self.write_err('%s at: %s:%d (%s)\n' % (
+msg, pycompat.sysbytes(frameinfo.filename),
+frameinfo.lineno, pycompat.sysbytes(frameinfo.function)))
+self.log('develwarn', '%s at: %s:%d (%s)\n',
+ msg, pycompat.sysbytes(frameinfo.filename),
+ frameinfo.lineno, pycompat.sysbytes(frameinfo.function))
 curframe = calframe = frameinfo = None  # avoid cycles
 
 def deprecwarn(self, msg, version, stacklevel=2):



To: indygreg, #hg-reviewers, pulkit, durin42
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2172: py3: convert FrameInfo members to bytes

2018-02-11 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The filename and function name fields are system strings. We need
  to convert them to bytes to work with our logging I/O.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2172

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1622,12 +1622,12 @@
 calframe = inspect.getouterframes(curframe, 2)
 frameinfo = calframe[stacklevel]
 
-self.write_err('%s at: %s:%s (%s)\n' % (
-msg, frameinfo.filename, frameinfo.lineno,
-frameinfo.function))
-self.log('develwarn', '%s at: %s:%s (%s)\n',
- msg, frameinfo.filename, frameinfo.lineno,
- frameinfo.function)
+self.write_err('%s at: %s:%d (%s)\n' % (
+msg, pycompat.sysbytes(frameinfo.filename),
+frameinfo.lineno, pycompat.sysbytes(frameinfo.function)))
+self.log('develwarn', '%s at: %s:%d (%s)\n',
+ msg, pycompat.sysbytes(frameinfo.filename),
+ frameinfo.lineno, pycompat.sysbytes(frameinfo.function))
 curframe = calframe = frameinfo = None  # avoid cycles
 
 def deprecwarn(self, msg, version, stacklevel=2):



To: indygreg, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel