Every now and then, it happens that I try importing a patch with two
consecutive dots in its name. Here's an example of what happens:
daenzer@kaveri|15:57:16> stg import -m /tmp/2-2-glamor-Add-an-assert-to-catch-the-previous-bug..patch
Checking for changes in the working directory ... done
fatal: Cannot lock the ref 'refs/patches/master/2-2-glamor-Add-an-assert-to-catch-the-previous-bug..patch'.
Traceback (most recent call last):
File "/usr/bin/stg", line 43, in <module>
main()
File "/usr/lib/python2.7/dist-packages/stgit/main.py", line 208, in main
_main()
File "/usr/lib/python2.7/dist-packages/stgit/main.py", line 187, in _main
directory.write_log(cmd)
File "/usr/lib/python2.7/dist-packages/stgit/commands/common.py", line 547, in write_log
log.compat_log_entry(msg)
File "/usr/lib/python2.7/dist-packages/stgit/lib/log.py", line 372, in compat_log_entry
log_entry(stack, msg)
File "/usr/lib/python2.7/dist-packages/stgit/lib/log.py", line 322, in log_entry
new_log = LogEntry.from_stack(last_log, stack, msg)
File "/usr/lib/python2.7/dist-packages/stgit/lib/log.py", line 179, in from_stack
for pn in stack.patchorder.all),
File "/usr/lib/python2.7/dist-packages/stgit/lib/log.py", line 179, in <genexpr>
for pn in stack.patchorder.all),
File "/usr/lib/python2.7/dist-packages/stgit/lib/stack.py", line 157, in get
return self.__patches[name]
File "/usr/lib/python2.7/dist-packages/stgit/lib/git.py", line 531, in __getitem__
self.__objects[name] = self.__create(name)
File "/usr/lib/python2.7/dist-packages/stgit/lib/stack.py", line 147, in create_patch
p.commit # raise exception if the patch doesn't exist
File "/usr/lib/python2.7/dist-packages/stgit/lib/stack.py", line 26, in commit
return self.__stack.repository.refs.get(self.__ref)
File "/usr/lib/python2.7/dist-packages/stgit/lib/git.py", line 494, in get
return self.__repository.get_commit(self.__refs[ref])
KeyError: 'refs/patches/master/2-2-glamor-Add-an-assert-to-catch-the-previous-bug..patch'
After that, the branch is in a bad state, with basically any stgit command
failing with a similar python traceback. I have to do some manual surgery to
get rid of the problematic patch.