Patchwork [RFC] lfs: clean up a variety of strings/bytes issues

login
register
mail settings
Submitter Augie Fackler
Date Jan. 25, 2019, 10:36 p.m.
Message ID <2DB968C9-CCF9-47BC-A29F-973710542106@durin42.com>
Download mbox | patch
Permalink /patch/38041/
State New
Headers show

Comments

Augie Fackler - Jan. 25, 2019, 10:36 p.m.
> On Jan 25, 2019, at 17:33, Augie Fackler <raf@durin42.com> wrote:
> 
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1548455589 18000
> #      Fri Jan 25 17:33:09 2019 -0500
> # Node ID d59571aba933f16db8e58ec9b61365ea4db0e2fa
> # Parent  ffdac0067a147f878ac45dc2c4b3b3e490865252
> lfs: clean up a variety of strings/bytes issues

Here's my gross hacks to try and force tracebacks and extract debug info, in case that's useful to anyone:

Patch

diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py
--- a/hgext/lfs/blobstore.py
+++ b/hgext/lfs/blobstore.py
@@ -568,7 +568,7 @@  class _promptremote(object):
     """Prompt user to set lfs.url when accessed."""
 
     def __init__(self, repo, url):
-        pass
+        self._repo = repo
 
     def writebatch(self, pointers, fromstore, ui=None):
         self._prompt()
@@ -577,6 +577,7 @@  class _promptremote(object):
         self._prompt()
 
     def _prompt(self):
+        assert False, u'%r %r' % (self._repo, self._repo.ui.configitems('path'))
         raise error.Abort(_('lfs.url needs to be configured'))
 
 _storemap = {
@@ -638,6 +639,11 @@  def remote(repo, remote=None):
             repo.ui.note(_('lfs: assuming remote store: %s\n') % url)
 
     scheme = url.scheme
+    if repo.ui.debugflag and scheme is None:
+        repo.ui.warn((u'%r %r %r %r %r %r\n' % (
+            scheme, [x for x in dir(repo) if u'subto' in x], path, defaulturl, url,
+            repo.ui.configitems('paths'))).encode('utf-8'))
+        repo.ui.flush()
     if scheme not in _storemap:
         raise error.Abort(_('lfs: unknown url scheme: %s') % scheme)
     return _storemap[scheme](repo, url)
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -777,7 +777,13 @@  def clone(ui, peeropts, source, dest=Non
             u.passwd = None
             defaulturl = bytes(u)
             destrepo.vfs.write('hgrc', util.tonativeeol(template % defaulturl))
-            destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone')
+            if destrepo.ui.debugflag:
+                ui.warn('wat(raf) clone url settting is %s\n' % defaulturl)
+            destrepo.unfiltered().ui.setconfig('paths', 'default', defaulturl, 'clone')
+            if destrepo.ui.debugflag:
+                ui.warn('wat(raf) debug info: %s %s\n' % (
+                    repr(destrepo).encode('utf8'),
+                    repr(destrepo.ui.configitems('paths')).encode('utf8')))
 
             if ui.configbool('experimental', 'remotenames'):
                 logexchange.pullremotenames(destrepo, srcpeer)