diff hgext3rd/fastimport/__init__.py @ 96:7eb15a5c4cad

Be consitent in how we use strings Everywhere else uses "string", so change to this in __init__.py
author Roy Marples <roy@marples.name>
date Fri, 22 Jan 2021 00:03:52 +0000
parents 3b398a887b95
children cde0e1d24e58
line wrap: on
line diff
--- a/hgext3rd/fastimport/__init__.py	Thu Jan 21 23:59:21 2021 +0000
+++ b/hgext3rd/fastimport/__init__.py	Fri Jan 22 00:03:52 2021 +0000
@@ -1,4 +1,4 @@
-''' import Git fast-import streams '''
+""" import Git fast-import streams """
 from __future__ import absolute_import
 
 from mercurial import (
@@ -17,9 +17,9 @@
 
 from .hgimport import fastimport_source
 
-__version__ = b'0.1.0'
-testedwith = b'5.6.1'
-minimumhgversion = b'4.1'
+__version__ = b"0.1.0"
+testedwith = b"5.6.1"
+minimumhgversion = b"4.1"
 
 cmdtable = {}
 try:
@@ -29,20 +29,20 @@
     from mercurial import cmdutil
     command = cmdutil.command(cmdtable)
 
-@command(b'fastimport',
-         [(b'', b'branchsort', None, _(b'try to sort changesets by branches')),
-          (b'', b'datesort', None, _(b'try to sort changesets by date')),
-          (b'', b'sourcesort', None, _(b'preserve source changesets order')),
-          (b'', b'blobpath', b'', _(b'path for persistent blob data'))],
-         _(b'hg fastimport SOURCE ...'),
+@command(b"fastimport",
+         [(b"", b"branchsort", None, _(b"try to sort changesets by branches")),
+          (b"", b"datesort", None, _(b"try to sort changesets by date")),
+          (b"", b"sourcesort", None, _(b"preserve source changesets order")),
+          (b"", b"blobpath", b"", _(b"path for persistent blob data"))],
+         _(b"hg fastimport SOURCE ..."),
           norepo=False)
 
 def fastimport(ui, repo, *sources, **opts):
-    '''Convert a git fastimport dump into Mercurial changesets.
+    """Convert a git fastimport dump into Mercurial changesets.
 
     Reads a series of SOURCE fastimport dumps and adds the resulting
     changes to the current Mercurial repository.
-    '''
+    """
     # Would be nice to just call hgext.convert.convcmd.convert() and let
     # it take care of things.  But syntax and semantics are just a
     # little mismatched:
@@ -54,24 +54,24 @@
     # Boo, hiss.
 
     if not sources:
-        sources = (b'-')
+        sources = (b"-")
 
     opts = pycompat.byteskwargs(opts)
 
     # assume fastimport metadata (usernames, commit messages) are
     # encoded UTF-8
     convcmd.orig_encoding = encoding.encoding
-    encoding.encoding = b'UTF-8'
+    encoding.encoding = b"UTF-8"
 
     # sink is the current repo, src is the list of fastimport streams
-    destc = hg.mercurial_sink(ui, b'hg', repo.root)
-    srcc = fastimport_source(ui, b'fastimport', repo, sources, opts[b'blobpath'])
+    destc = hg.mercurial_sink(ui, b"hg", repo.root)
+    srcc = fastimport_source(ui, b"fastimport", repo, sources, opts[b"blobpath"])
 
-    defaultsort = b'branchsort'          # for efficiency and consistency
-    sortmodes = (b'branchsort', b'datesort', b'sourcesort')
+    defaultsort = b"branchsort"          # for efficiency and consistency
+    sortmodes = (b"branchsort", b"datesort", b"sourcesort")
     sortmode = [m for m in sortmodes if opts.get(m)]
     if len(sortmode) > 1:
-        raise error.Abort(_(b'more than one sort mode specified'))
+        raise error.Abort(_(b"more than one sort mode specified"))
     if sortmode:
         sortmode = sortmode[0]
     else: