global: make some docstrings raw strings
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 04 Feb 2019 09:07:00 -0800
changeset 41533 0f64091cc851
parent 41532 bd3f03d8cc9f
child 41534 47c92f8ed128
global: make some docstrings raw strings Python 3.8 emits a SyntaxWarning when a str/bytes contains invalid \ escapes. Various docstrings in our code base contain invalid \ escapes. This commit turns those docstrings into raw strings. Differential Revision: https://phab.mercurial-scm.org/D5816
hgext/rebase.py
mercurial/bookmarks.py
mercurial/dagop.py
setup.py
--- a/hgext/rebase.py	Mon Feb 04 08:54:30 2019 -0800
+++ b/hgext/rebase.py	Mon Feb 04 09:07:00 2019 -0800
@@ -1278,7 +1278,7 @@
     return stats
 
 def adjustdest(repo, rev, destmap, state, skipped):
-    """adjust rebase destination given the current rebase state
+    r"""adjust rebase destination given the current rebase state
 
     rev is what is being rebased. Return a list of two revs, which are the
     adjusted destinations for rev's p1 and p2, respectively. If a parent is
--- a/mercurial/bookmarks.py	Mon Feb 04 08:54:30 2019 -0800
+++ b/mercurial/bookmarks.py	Mon Feb 04 09:07:00 2019 -0800
@@ -44,7 +44,7 @@
     return fp
 
 class bmstore(object):
-    """Storage for bookmarks.
+    r"""Storage for bookmarks.
 
     This object should do all bookmark-related reads and writes, so
     that it's fairly simple to replace the storage underlying
--- a/mercurial/dagop.py	Mon Feb 04 08:54:30 2019 -0800
+++ b/mercurial/dagop.py	Mon Feb 04 09:07:00 2019 -0800
@@ -142,7 +142,7 @@
 
 def revancestors(repo, revs, followfirst=False, startdepth=None,
                  stopdepth=None, cutfunc=None):
-    """Like revlog.ancestors(), but supports additional options, includes
+    r"""Like revlog.ancestors(), but supports additional options, includes
     the given revs themselves, and returns a smartset
 
     Scan ends at the stopdepth (exlusive) if specified. Revisions found
--- a/setup.py	Mon Feb 04 08:54:30 2019 -0800
+++ b/setup.py	Mon Feb 04 09:07:00 2019 -0800
@@ -666,7 +666,7 @@
             self.addlongpathsmanifest()
 
     def addlongpathsmanifest(self):
-        """Add manifest pieces so that hg.exe understands long paths
+        r"""Add manifest pieces so that hg.exe understands long paths
 
         This is an EXPERIMENTAL feature, use with care.
         To enable long paths support, one needs to do two things: