Comment 2 for bug 75577

Revision history for this message
Stuart Bishop (stub) wrote : Re: [Bug 75577] shelve raises exception

I think the trigger is changing lines starting with '--' (found as comments
in .sql scripts). Here is a test case:

11:08:33~/tmp $ mkdir foo
11:08:34~/tmp $ cd foo/
11:08:35~/tmp/foo $ bzr init
11:08:53~/tmp/foo $ vi foo.txt
11:09:39~/tmp/foo $ cat foo.txt
This is jibberish

-- This is an SQL comment
-- CREATE FUNCTION foo

This is more jibberish
11:09:44~/tmp/foo $ bzr add foo.txt
added foo.txt
11:09:51~/tmp/foo $ bzr commit -m 'Whatever'
added foo.txt
Committed revision 1.
11:10:03~/tmp/foo $ vi foo.txt
11:10:22~/tmp/foo $ bzr diff
=== modified file 'foo.txt'
--- foo.txt 2006-12-14 04:09:54 +0000
+++ foo.txt 2006-12-14 04:10:22 +0000
@@ -1,6 +1,8 @@
 This is jibberish

 -- This is an SQL comment
--- CREATE FUNCTION foo
+CREATE FUNCTION foo AS
+$$
+$$;

 This is more jibberish

11:10:24~/tmp/foo $ bzr shelve
bzr: ERROR: bzrlib.patches.PatchSyntax: No mod name

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 626, in
run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 588, in
run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 292, in
run_argv_aliases
    return self.run(**all_cmd_args)
  File
"/usr/lib/python2.4/site-packages/bzrlib/plugins/bzrtools/__init__.py", line
248, in run
    s.shelve(source, all, message, no_color)
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/bzrtools/shelf.py",
line 203, in shelve
    patches = patch_source.readpatches()
  File
"/usr/lib/python2.4/site-packages/bzrlib/plugins/bzrtools/patchsource.py",
line 14, in readpatches
    return patches.parse_patches(self.readlines())
  File "/usr/lib/python2.4/site-packages/bzrlib/patches.py", line 355, in
parse_patches
    return [parse_patch(f.__iter__()) for f in iter_file_patch(iter_lines)]
  File "/usr/lib/python2.4/site-packages/bzrlib/patches.py", line 310, in
parse_patch
    (orig_name, mod_name) = get_patch_names(iter_lines)
  File "/usr/lib/python2.4/site-packages/bzrlib/patches.py", line 69, in
get_patch_names
    raise PatchSyntax("No mod name")
PatchSyntax: No mod name

bzr 0.13.0 on python 2.4.4.candidate.1 (linux2)
arguments: ['/usr/bin/bzr', 'shelve']

** please send this report to <email address hidden>
11:10:27~/tmp/foo $

--
Stuart Bishop <email address hidden> http://www.canonical.com/
Canonical Ltd. http://www.ubuntu.com/