TypeError in 3.28
reposurgeon 3.28 will throw a TypeError when reading a git repo.
This error was introduced in commit bf02b805. preserve
should always be a set, but here it is initialized to a tuple.
Steps to reproduce
mkdir bug-report
cd bug-report
git init
touch foo
git add foo
git commit -am "add foo"
reposurgeon read
Traceback
Traceback (most recent call last):
File "/usr/local/bin/reposurgeon", line 11178, in <module>
cmd.Cmd.onecmd(interpreter, interpreter.precmd(arg))
File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cmd.py", line 221, in onecmd
return func(arg)
File "/usr/local/bin/reposurgeon", line 8631, in do_read
repo = read_repo(os.getcwd(), parse.options, self.preferred)
File "/usr/local/bin/reposurgeon", line 6353, in read_repo
repo.preserve_set |= (allfiles - repofiles)
TypeError: unsupported operand type(s) for |=: 'tuple' and 'set'
Patch
I'd submit this as a pull request, but it was taking forever to clone the repo. I get very slow download speeds from my connection to GitLab.
diff --git a/reposurgeon b/reposurgeon
--- a/reposurgeon
+++ b/reposurgeon
@@ -193,7 +193,7 @@ vcstypes = [
importer=b"git fast-import --quiet",
checkout=b"git checkout",
lister=b"git ls-files",
- preserve=(b'.git/config', b'.git/hooks'),
+ preserve=set([b'.git/config', b'.git/hooks']),
authormap=b".git/cvs-authors",
ignorename=b".gitignore",
dfltignores=b"", # Has none