Mercurial > kallithea
annotate docs/usage/backup.rst @ 8455:d727e81e0097 stable
vcs: fix cloning remote repository with HTTP authentication (Issue #379)
Using a remote clone URI of
http://user:pass@host/...
triggered an exception:
...
E File ".../kallithea/lib/utils.py", line 256, in is_valid_repo_uri
E GitRepository._check_url(url)
E File ".../kallithea/lib/vcs/backends/git/repository.py", line 183, in _check_url
E passmgr.add_password(*authinfo)
E File "/usr/lib/python3.7/urllib/request.py", line 848, in add_password
E self.reduce_uri(u, default_port) for u in uri)
E File "/usr/lib/python3.7/urllib/request.py", line 848, in <genexpr>
E self.reduce_uri(u, default_port) for u in uri)
E File "/usr/lib/python3.7/urllib/request.py", line 875, in reduce_uri
E host, port = splitport(authority)
E File "/usr/lib/python3.7/urllib/parse.py", line 1022, in splitport
E match = _portprog.fullmatch(host)
E TypeError: cannot use a string pattern on a bytes-like object
The authinfo tuple is obtained via mercurial.util.url, which unfortunately
returns a tuple of bytes whereas urllib expects strings.
It seems that mercurial internally has some more hacking around urllib as
urllibcompat.py, which we don't use.
Therefore, transform the bytes into strings before passing authinfo to
urllib. As the realm can be None, we need to check it specifically otherwise
safe_str would return a string 'None'.
A basic test that catches the mentioned problem is added, even though it
does not actually test that cloning with auth info will actually work (it
only tests that it fails cleanly if the URI is not reachable).
Additionally, one use of 'test_uri' in hg/repository.py still needed to be
transformed from bytes to string. For git this was already ok.
author | Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> |
---|---|
date | Wed, 22 Jul 2020 21:55:57 +0200 |
parents | fbbe80e3322b |
children |
rev | line source |
---|---|
1104
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
1 .. _backup: |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
2 |
2095 | 3 ==================== |
4192
e73a69cb98dc
Rename some strings examples and commands in documentation
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3224
diff
changeset
|
4 Backing up Kallithea |
1104
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
5 ==================== |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
6 |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
7 |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
8 Settings |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
9 -------- |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
10 |
4192
e73a69cb98dc
Rename some strings examples and commands in documentation
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3224
diff
changeset
|
11 Just copy your .ini file, it contains all Kallithea settings. |
1104
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
12 |
5433
fbbe80e3322b
docs: consistent spacing around headings
Mads Kiilerich <madski@unity3d.com>
parents:
4955
diff
changeset
|
13 |
1104
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
14 Whoosh index |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
15 ------------ |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
16 |
4955
4e6dfdb3fa01
docs: English and consistency corrections
Michael V. DePalatis <mike@depalatis.net>
parents:
4192
diff
changeset
|
17 The Whoosh index is located in the ``data/index`` directory where you installed |
4e6dfdb3fa01
docs: English and consistency corrections
Michael V. DePalatis <mike@depalatis.net>
parents:
4192
diff
changeset
|
18 Kallithea, i.e., the same place where the ini file is located |
1104
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
19 |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
20 |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 Database |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
22 -------- |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
23 |
4192
e73a69cb98dc
Rename some strings examples and commands in documentation
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3224
diff
changeset
|
24 When using sqlite just copy kallithea.db. |
1104
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
25 Any other database engine requires a manual backup operation. |
af371e206ec5
added backup to docs
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
26 |
4955
4e6dfdb3fa01
docs: English and consistency corrections
Michael V. DePalatis <mike@depalatis.net>
parents:
4192
diff
changeset
|
27 A database backup will contain all gathered statistics. |