diff mercurial/obsolete.py @ 43554:9f70512ae2cf

cleanup: remove pointless r-prefixes on single-quoted strings This is the promised second step on single-quoted strings. These had existed because our source transformer didn't turn r'' into b'', so we had tagged some strings as r-strings to get "native" strings on both Pythons. Now that the transformer is gone, we can dispense with this nonsense. Methodology: I ran hg locate 'set:added() or modified() or clean()' | egrep '.*\.py$' | xargs egrep --color=never -n -- \[\^b\]\[\^a-z\]r\'\[\^\'\\\\\]\*\'\[\^\'\ in an emacs grep-mode buffer, and then used a keyboard macro to iterate over the results and remove the r prefix as needed. # skip-blame removing unneeded r prefixes left over from Python 3 migration. Differential Revision: https://phab.mercurial-scm.org/D7306
author Augie Fackler <augie@google.com>
date Fri, 08 Nov 2019 11:19:20 -0800
parents 4353942be294
children 1542773ffa5d
line wrap: on
line diff
--- a/mercurial/obsolete.py	Sun Nov 10 07:30:14 2019 -0800
+++ b/mercurial/obsolete.py	Fri Nov 08 11:19:20 2019 -0800
@@ -87,7 +87,7 @@
 )
 from .utils import dateutil
 
-parsers = policy.importmod(r'parsers')
+parsers = policy.importmod('parsers')
 
 _pack = struct.pack
 _unpack = struct.unpack
@@ -580,7 +580,7 @@
         return len(self._all)
 
     def __nonzero__(self):
-        if not self._cached(r'_all'):
+        if not self._cached('_all'):
             try:
                 return self.svfs.stat(b'obsstore').st_size > 1
             except OSError as inst:
@@ -641,7 +641,7 @@
                 raise ValueError(succ)
         if prec in succs:
             raise ValueError(
-                r'in-marker cycle with %s' % pycompat.sysstr(node.hex(prec))
+                'in-marker cycle with %s' % pycompat.sysstr(node.hex(prec))
             )
 
         metadata = tuple(sorted(pycompat.iteritems(metadata)))
@@ -752,11 +752,11 @@
         markers = list(markers)  # to allow repeated iteration
         self._data = self._data + rawdata
         self._all.extend(markers)
-        if self._cached(r'successors'):
+        if self._cached('successors'):
             _addsuccessors(self.successors, markers)
-        if self._cached(r'predecessors'):
+        if self._cached('predecessors'):
             _addpredecessors(self.predecessors, markers)
-        if self._cached(r'children'):
+        if self._cached('children'):
             _addchildren(self.children, markers)
         _checkinvalidmarkers(markers)
 
@@ -802,7 +802,7 @@
     # rely on obsstore class default when possible.
     kwargs = {}
     if defaultformat is not None:
-        kwargs[r'defaultformat'] = defaultformat
+        kwargs['defaultformat'] = defaultformat
     readonly = not isenabled(repo, createmarkersopt)
     store = obsstore(repo.svfs, readonly=readonly, **kwargs)
     if store and readonly: