changeset 43543:daade078f1f0

merge with stable
author Yuya Nishihara <yuya@tcha.org>
date Fri, 08 Nov 2019 23:26:50 +0900
parents 5d40317d42b7 (current diff) be0f77fd274d (diff)
children 2ade00f3b03b
files contrib/perf.py mercurial/bundle2.py
diffstat 8 files changed, 38 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Thu Oct 17 19:29:22 2019 -0400
+++ b/contrib/perf.py	Fri Nov 08 23:26:50 2019 +0900
@@ -691,8 +691,8 @@
         def clearcache():
             # _tagscache has been filteredpropertycache since 2.5 (or
             # 98c867ac1330), and delattr() can't work in such case
-            if b'_tagscache' in vars(repo):
-                del repo.__dict__[b'_tagscache']
+            if '_tagscache' in vars(repo):
+                del repo.__dict__['_tagscache']
 
         return clearcache
 
--- a/hgext/fastannotate/context.py	Thu Oct 17 19:29:22 2019 -0400
+++ b/hgext/fastannotate/context.py	Fri Nov 08 23:26:50 2019 +0900
@@ -57,7 +57,7 @@
     # renamed filectx won't have a filelog yet, so set it
     # from the cache to save time
     for p in pl:
-        if not b'_filelog' in p.__dict__:
+        if not '_filelog' in p.__dict__:
             p._filelog = _getflog(f._repo, p.path())
 
     return pl
--- a/hgext/mq.py	Thu Oct 17 19:29:22 2019 -0400
+++ b/hgext/mq.py	Fri Nov 08 23:26:50 2019 +0900
@@ -567,7 +567,7 @@
         return self.seriesguards
 
     def invalidate(self):
-        for a in b'applied fullseries series seriesguards'.split():
+        for a in 'applied fullseries series seriesguards'.split():
             if a in self.__dict__:
                 delattr(self, a)
         self.applieddirty = False
--- a/mercurial/bundle2.py	Thu Oct 17 19:29:22 2019 -0400
+++ b/mercurial/bundle2.py	Fri Nov 08 23:26:50 2019 +0900
@@ -861,7 +861,7 @@
         needed to move forward to get general delta enabled.
         """
         yield self._magicstring
-        assert b'params' not in vars(self)
+        assert 'params' not in vars(self)
         paramssize = self._unpack(_fstreamparamsize)[0]
         if paramssize < 0:
             raise error.BundleValueError(
--- a/mercurial/crecord.py	Thu Oct 17 19:29:22 2019 -0400
+++ b/mercurial/crecord.py	Fri Nov 08 23:26:50 2019 +0900
@@ -24,7 +24,6 @@
     encoding,
     error,
     patch as patchmod,
-    pycompat,
     scmutil,
     util,
 )
@@ -60,6 +59,7 @@
 
 try:
     import curses
+    import curses.ascii
 
     curses.error
 except ImportError:
@@ -607,8 +607,8 @@
 
     chunkselector.stdscr = dummystdscr()
     if testfn and os.path.exists(testfn):
-        testf = open(testfn, b'rb')
-        testcommands = [x.rstrip(b'\n') for x in testf.readlines()]
+        testf = open(testfn, 'r')
+        testcommands = [x.rstrip('\n') for x in testf.readlines()]
         testf.close()
         while True:
             if chunkselector.handlekeypressed(testcommands.pop(0), test=True):
@@ -1741,8 +1741,8 @@
         with self.ui.timeblockedsection(b'crecord'):
             response = self.confirmationwindow(confirmtext)
         if response is None:
-            response = b"n"
-        if response.lower().startswith(b"y"):
+            response = "n"
+        if response.lower().startswith("y"):
             return True
         else:
             return False
@@ -1887,60 +1887,59 @@
 
         Return true to exit the main loop.
         """
-        keypressed = pycompat.bytestr(keypressed)
-        if keypressed in [b"k", b"KEY_UP"]:
+        if keypressed in ["k", "KEY_UP"]:
             self.uparrowevent()
-        elif keypressed in [b"K", b"KEY_PPAGE"]:
+        elif keypressed in ["K", "KEY_PPAGE"]:
             self.uparrowshiftevent()
-        elif keypressed in [b"j", b"KEY_DOWN"]:
+        elif keypressed in ["j", "KEY_DOWN"]:
             self.downarrowevent()
-        elif keypressed in [b"J", b"KEY_NPAGE"]:
+        elif keypressed in ["J", "KEY_NPAGE"]:
             self.downarrowshiftevent()
-        elif keypressed in [b"l", b"KEY_RIGHT"]:
+        elif keypressed in ["l", "KEY_RIGHT"]:
             self.rightarrowevent()
-        elif keypressed in [b"h", b"KEY_LEFT"]:
+        elif keypressed in ["h", "KEY_LEFT"]:
             self.leftarrowevent()
-        elif keypressed in [b"H", b"KEY_SLEFT"]:
+        elif keypressed in ["H", "KEY_SLEFT"]:
             self.leftarrowshiftevent()
-        elif keypressed in [b"q"]:
+        elif keypressed in ["q"]:
             raise error.Abort(_(b'user quit'))
-        elif keypressed in [b'a']:
+        elif keypressed in ['a']:
             self.toggleamend(self.opts, test)
-        elif keypressed in [b"c"]:
+        elif keypressed in ["c"]:
             return True
-        elif keypressed in [b"r"]:
+        elif keypressed in ["r"]:
             if self.reviewcommit():
                 self.opts[b'review'] = True
                 return True
-        elif test and keypressed in [b'R']:
+        elif test and keypressed in ["R"]:
             self.opts[b'review'] = True
             return True
-        elif keypressed in [b' ', b'x']:
+        elif keypressed in [" ", "x"]:
             self.toggleapply()
-        elif keypressed in [b'\n', b'KEY_ENTER']:
+        elif keypressed in ["\n", "KEY_ENTER"]:
             self.toggleapply()
             self.nextsametype(test=test)
-        elif keypressed in [b'X']:
+        elif keypressed in ["X"]:
             self.toggleallbetween()
-        elif keypressed in [b'A']:
+        elif keypressed in ["A"]:
             self.toggleall()
-        elif keypressed in [b'e']:
+        elif keypressed in ["e"]:
             self.toggleedit(test=test)
-        elif keypressed in [b"f"]:
+        elif keypressed in ["f"]:
             self.togglefolded()
-        elif keypressed in [b"F"]:
+        elif keypressed in ["F"]:
             self.togglefolded(foldparent=True)
-        elif keypressed in [b"m"]:
+        elif keypressed in ["m"]:
             self.commitMessageWindow()
-        elif keypressed in [b"g", b"KEY_HOME"]:
+        elif keypressed in ["g", "KEY_HOME"]:
             self.handlefirstlineevent()
-        elif keypressed in [b"G", b"KEY_END"]:
+        elif keypressed in ["G", "KEY_END"]:
             self.handlelastlineevent()
-        elif keypressed in [b"?"]:
+        elif keypressed in ["?"]:
             self.helpwindow()
             self.stdscr.clear()
             self.stdscr.refresh()
-        elif curses.unctrl(keypressed) in [b"^L"]:
+        elif keypressed in [curses.ascii.ctrl("L")]:
             # scroll the current line to the top of the screen, and redraw
             # everything
             self.scrolllines(self.selecteditemstartline)
--- a/mercurial/hgweb/server.py	Thu Oct 17 19:29:22 2019 -0400
+++ b/mercurial/hgweb/server.py	Fri Nov 08 23:26:50 2019 +0900
@@ -160,7 +160,7 @@
             self.server.prefix + b'/'
         ):
             self._start_response(pycompat.strurl(common.statusmessage(404)), [])
-            if self.command == b'POST':
+            if self.command == r'POST':
                 # Paranoia: tell the client we're going to close the
                 # socket so they don't try and reuse a socket that
                 # might have a POST body waiting to confuse us. We do
--- a/mercurial/localrepo.py	Thu Oct 17 19:29:22 2019 -0400
+++ b/mercurial/localrepo.py	Fri Nov 08 23:26:50 2019 +0900
@@ -3199,7 +3199,7 @@
         # When using the same lock to commit and strip, the phasecache is left
         # dirty after committing. Then when we strip, the repo is invalidated,
         # causing those changes to disappear.
-        if b'_phasecache' in vars(self):
+        if '_phasecache' in vars(self):
             self._phasecache.write()
 
     @unfilteredmethod
--- a/mercurial/merge.py	Thu Oct 17 19:29:22 2019 -0400
+++ b/mercurial/merge.py	Fri Nov 08 23:26:50 2019 +0900
@@ -171,7 +171,7 @@
         self._local = None
         self._other = None
         self._labels = labels
-        for var in (b'localctx', b'otherctx'):
+        for var in ('localctx', 'otherctx'):
             if var in vars(self):
                 delattr(self, var)
         if node:
@@ -196,7 +196,7 @@
         self._stateextras = {}
         self._local = None
         self._other = None
-        for var in (b'localctx', b'otherctx'):
+        for var in ('localctx', 'otherctx'):
             if var in vars(self):
                 delattr(self, var)
         self._readmergedriver = None