Bug#1053587: simple-revision-control: Fails when importing legacy RCS files with "description" content

2024-02-23 Thread Daichi Fukui
Hello Penney,

On Sat, 07 Oct 2023 06:51:59 +0100 RW Penney
 wrote:
>
> When using simple-revision-control to import RCS histories, it appears
> unable to handle RCS files that include a non-empty "description" field.
> This seems to be because the "src" application treats this field
> as JSON, which may be inconsistent with the RCS file format,
> as well as the format used by the RCS tools currently in bookworm.

Thank you for reporting the bug.
The bug you reported is fixed with the following upstream commit:
https://gitlab.com/esr/src/-/commit/9917f118882fa57b7ae171cd4a27fce0c59f54f7

That commit is included in the latest package 1.33-1.

Best,
Fukui



Bug#1053587: simple-revision-control: Fails when importing legacy RCS files with "description" content

2023-10-06 Thread RW Penney
Package: simple-revision-control
Version: 1.29-1
Severity: important
Tags: patch
X-Debbugs-Cc: rwpen...@users.sourceforge.net

Dear Maintainer,

When using simple-revision-control to import RCS histories, it appears
unable to handle RCS files that include a non-empty "description" field.
This seems to be because the "src" application treats this field
as JSON, which may be inconsistent with the RCS file format,
as well as the format used by the RCS tools currently in bookworm.

An example scenario is as follows:

$ mkdir RCS
$ echo "Interesting content" > file0.txt
$ ci -i -t-"A tiny file for testing" -m"Initial commit" file0.txt
RCS/file0.txt,v  <--  file0.txt
initial revision: 1.1
done

$ echo "Fascinating content" > file1.txt
$ ci -i -t-"" -m"Initial commit" file1.txt
RCS/file1.txt,v  <--  file1.txt
initial revision: 1.1
done

$ src srcify

$ src log file0.txt
= file0.txt
===
src: legacy data A tiny file for testing in description field
src: fatal exception in popen_or_die.

$ src log file1.txt
= file1.txt
===
1| 2023-10-07T05:14:35Z | trunk
Initial commit
---


It appears that current upstream versions of simple-revision-control do not
make any use of a JSON parser, and minor changes to a try/except block
near line 448 of /usr/bin/src will resolve this issue. Without such a change
it appears to be impossible to make simple-revision-control usable
with legacy RCS histories.


-- System Information:
Debian Release: 12.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-12-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages simple-revision-control depends on:
ii  python3  3.11.2-1+b1
ii  rcs  5.10.1-1

simple-revision-control recommends no packages.

Versions of packages simple-revision-control suggests:
pn  sccs  

-- no debconf information
--- src-orig2022-03-21 13:15:22.0 +
+++ src 2023-10-07 06:22:52.639950705 +0100
@@ -448,7 +448,7 @@
 # is not an issue.
 self.annotations = json.loads(self.description.strip())
 except ValueError as _e:
-croak("legacy data %s in description field" % self.description)
+announce("legacy data %s in description field" % 
self.description)
 def lift_headers(self):
 valid = ('author', 'author-date', 'committer', 'committer-date',
  'mark', 'parents')