>Number:         6493
>Category:       user
>Synopsis:       opencvs release fails to list modified files
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Tue Oct 19 06:30:01 GMT 2010
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        
>Organization:
>Environment:
        System      : OpenBSD 4.7 
        Details     : OpenBSD 4.7 (GENERIC) #112: Wed Mar 17 20:43:49 MDT 2010
                    
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
    
        Architecture: OpenBSD.amd64
        Machine     : amd64
>Description:
GNU cvs produces a list of unknown and modified files when the "cvs release ." 
command is specified.
For remote repositories, opencvs release produces garbage and dies.
For local repositories, opencvs release appears to do nothing.

>How-To-Repeat:
Something like this...

xxx:~/s0/src/usr.bin/cvs$ printenv CVSROOT
anon...@anoncvs1.ca.openbsd.org:/cvs
xxx:~/s0/src/usr.bin/cvs$ cvs release .
? cvsintro.cat7
? date.c
? opencvs
M README
You have [1] altered files in this repository.
Are you sure you want to release directory `.': ^Ccvs [release aborted]: 
received interrupt signal
Killed by signal 2.
xxx:~/s0/src/usr.bin/cvs$ opencvs release .
opencvs [release aborted]: cvs_repository_getdir: failed to open 
'o?=$<Lo?=o?=o?=o?=o?=o?='

...

xxx:~/sandbox.dummy/test2$ printenv CVSROOT
/home/mwb/cvs.dummy
xxx:~/sandbox.dummy/test2$ cvs release .
M a
? b
You have [1] altered files in this repository.
Are you sure you want to release directory `.': ^Ccvs [release aborted]: 
received interrupt signal
xxx:~/sandbox.dummy/test2$ opencvs release .
xxx:~/sandbox.dummy/test2$ 

>Fix:
The patch provided causes opencvs to produce a list of modified files.

The following output is for a local repository.
Please note that this isn't a fix for the incorrect number of altered files.

xxx:~/sandbox.dummy/test2$ printenv CVSROOT
/home/mwb/cvs.dummy
xxx:~/sandbox.dummy/test2$ cvs release .
M a
? b
You have [1] altered files in this repository.
Are you sure you want to release directory `.': ^Ccvs [release aborted]: 
received interrupt signal
xxx:~/sandbox.dummy/test2$ opencvs release .
M a
? b
You have [0] altered files in this repository.
Are you sure you want to release directory `.': ^C
** `release' aborted by user choice.
opencvs [release aborted]: received signal 2

And for a remote repository:

xxx:~/s0/src/usr.bin/cvs$ printenv CVSROOT
anon...@anoncvs1.ca.openbsd.org:/cvs
xxx:~/s0/src/usr.bin/cvs$ cvs release .
? cvsintro.cat7
? date.c
? opencvs
M README
M client.c
M file.c
M release.c
You have [4] altered files in this repository.
Are you sure you want to release directory `.': ^Ccvs [release aborted]: 
received interrupt signal
Killed by signal 2.
xxx:~/s0/src/usr.bin/cvs$ ./opencvs release .
M README
M client.c
M file.c
M release.c
? cvsintro.cat7
? date.c
? opencvs
xxx:~/s0/src/usr.bin/cvs$ 

The number of modified/unknown files at least matches up with the output of GNU 
cvs.

My patch is not perfect so please take it as a suggestion only.
Maybe the right thing would be to call cvs_update() on all modified files;
I'm not sure about that so my patch just prints the filename directly.


Index: client.c
===================================================================
RCS file: /cvs/src/usr.bin/cvs/client.c,v
retrieving revision 1.123
diff -u -r1.123 client.c
--- client.c    29 Sep 2010 18:14:52 -0000      1.123
+++ client.c    19 Oct 2010 03:23:51 -0000
@@ -527,6 +527,8 @@
                if (backup_local_changes)       /* for update -C */
                        cvs_backup_file(cf);
 
+               if (cvs_cmdop == CVS_OP_RELEASE)
+                       cvs_printf("M %s\n", cf->file_name);
                cvs_client_send_request("Modified %s", cf->file_name);
                cvs_remote_send_file(cf->file_path, cf->fd);
                break;
@@ -540,6 +542,8 @@
                        break;
                }
 
+               if (cvs_cmdop == CVS_OP_RELEASE)
+                       cvs_printf("M %s\n", cf->file_name);
                cvs_client_send_request("Modified %s", cf->file_name);
                cvs_remote_send_file(cf->file_path, cf->fd);
                break;
Index: file.c
===================================================================
RCS file: /cvs/src/usr.bin/cvs/file.c,v
retrieving revision 1.261
diff -u -r1.261 file.c
--- file.c      27 Sep 2010 14:08:41 -0000      1.261
+++ file.c      19 Oct 2010 03:23:51 -0000
@@ -592,7 +592,7 @@
                cvs_repository_lock(repo, (cmdp->cmd_flags & CVS_LOCK_REPO));
        }
 
-       if (cr->flags & CR_REPO) {
+       if (current_cvsroot->cr_method == CVS_METHOD_LOCAL && cr->flags & 
CR_REPO) {
                xsnprintf(fpath, sizeof(fpath), "%s/%s", cf->file_path,
                    CVS_PATH_STATICENTRIES);
 
Index: release.c
===================================================================
RCS file: /cvs/src/usr.bin/cvs/release.c,v
retrieving revision 1.41
diff -u -r1.41 release.c
@@ -100,9 +100,6 @@
        char *arg = ".";
        int saved_noexec;
 
-       if (cf->file_type == CVS_FILE)
-               return;
-
        cvs_log(LP_TRACE, "cvs_release_local(%s)", cf->file_path);
 
        cvs_file_classify(cf, cvs_directory_tag);
@@ -156,7 +153,7 @@
        (void)printf("You have [%d] altered files in this repository.\n",
            files_altered);
        (void)printf("Are you sure you want to release %sdirectory `%s': ",
-               (dflag == 1) ? "(and delete) " : "", cf->file_path);
+               (dflag == 1) ? "(and delete) " : "", arg);
 
        if (cvs_yesno() == -1) {
                (void)fprintf(stderr,




dmesg:
OpenBSD 4.7 (GENERIC) #112: Wed Mar 17 20:43:49 MDT 2010
    dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
real mem = 804192256 (766MB)
avail mem = 770875392 (735MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xfbd3f (10 entries)
bios0: vendor QEMU version "QEMU" date 01/01/2007
acpi0 at bios0: rev 0
acpi0: tables DSDT FACP APIC
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
acpiprt0 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0
mpbios at bios0 not configured
cpu0 at mainbus0: (uniprocessor)
cpu0: QEMU Virtual CPU version 0.9.1, 2667.25 MHz
cpu0: 
FPU,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3,NXE,LONG
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache
cpu0: ITLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
cpu0: DTLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel 82441FX" rev 0x02
pcib0 at pci0 dev 1 function 0 "Intel 82371SB ISA" rev 0x00
pciide0 at pci0 dev 1 function 1 "Intel 82371SB IDE" rev 0x00: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <QEMU HARDDISK>
wd0: 16-sector PIO, LBA48, 20480MB, 41943040 sectors
atapiscsi0 at pciide0 channel 0 drive 1
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <QEMU, QEMU DVD-ROM, 0.9.> ATAPI 5/cdrom removable
wd0(pciide0:0:0): using PIO mode 0, DMA mode 2
cd0(pciide0:0:1): using PIO mode 0
atapiscsi1 at pciide0 channel 1 drive 0
scsibus1 at atapiscsi1: 2 targets
cd1 at scsibus1 targ 0 lun 0: <QEMU, QEMU DVD-ROM, 0.9.> ATAPI 5/cdrom removable
cd1(pciide0:1:0): using PIO mode 0
uhci0 at pci0 dev 1 function 2 "Intel 82371SB USB" rev 0x01: irq 11
piixpm0 at pci0 dev 1 function 3 "Intel 82371AB Power" rev 0x03: irq 10
iic0 at piixpm0
iic0: addr 0x18 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x1a 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x29 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x2b 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x48 48=00 words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 
06=0000 07=0000
iic0: addr 0x49 48=00 words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 
06=0000 07=0000
iic0: addr 0x4a 48=00 words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 
06=0000 07=0000
iic0: addr 0x4b 48=00 words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 
06=0000 07=0000
iic0: addr 0x4c 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 48=00 
words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x4d 48=00 words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 
06=0000 07=0000
iic0: addr 0x4e 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 48=00 
words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
vga1 at pci0 dev 2 function 0 "Cirrus Logic CL-GD5446" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
em0 at pci0 dev 3 function 0 "Intel PRO/1000MT (82540EM)" rev 0x03: irq 11, 
address 52:54:00:27:21:96
"Qumranet Virtio Memory" rev 0x00 at pci0 dev 4 function 0 not configured
"Qumranet Virtio Console" rev 0x00 at pci0 dev 5 function 0 not configured
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com0: probed fifo depth: 0 bytes
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: density unknown
fd1 at fdc0 drive 1: density unknown
usb0 at uhci0: USB revision 1.0
uhub0 at usb0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
nvram: invalid checksum
mtrr: Pentium Pro MTRR support
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
root on wd0a swap on wd0b dump on wd0b
clock: unknown CMOS layout
syncing disks... done
rebooting...
OpenBSD 4.7 (GENERIC) #112: Wed Mar 17 20:43:49 MDT 2010
    dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
real mem = 804192256 (766MB)
avail mem = 770875392 (735MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xfbd3f (10 entries)
bios0: vendor QEMU version "QEMU" date 01/01/2007
acpi0 at bios0: rev 0
acpi0: tables DSDT FACP APIC
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
acpiprt0 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0
mpbios at bios0 not configured
cpu0 at mainbus0: (uniprocessor)
cpu0: QEMU Virtual CPU version 0.9.1, 2665.99 MHz
cpu0: 
FPU,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3,NXE,LONG
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache
cpu0: ITLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
cpu0: DTLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel 82441FX" rev 0x02
pcib0 at pci0 dev 1 function 0 "Intel 82371SB ISA" rev 0x00
pciide0 at pci0 dev 1 function 1 "Intel 82371SB IDE" rev 0x00: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <QEMU HARDDISK>
wd0: 16-sector PIO, LBA48, 20480MB, 41943040 sectors
atapiscsi0 at pciide0 channel 0 drive 1
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <QEMU, QEMU DVD-ROM, 0.9.> ATAPI 5/cdrom removable
wd0(pciide0:0:0): using PIO mode 0, DMA mode 2
cd0(pciide0:0:1): using PIO mode 0
atapiscsi1 at pciide0 channel 1 drive 0
scsibus1 at atapiscsi1: 2 targets
cd1 at scsibus1 targ 0 lun 0: <QEMU, QEMU DVD-ROM, 0.9.> ATAPI 5/cdrom removable
cd1(pciide0:1:0): using PIO mode 0
uhci0 at pci0 dev 1 function 2 "Intel 82371SB USB" rev 0x01: irq 11
piixpm0 at pci0 dev 1 function 3 "Intel 82371AB Power" rev 0x03: irq 10
iic0 at piixpm0
iic0: addr 0x18 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x1a 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x29 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x2b 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x48 48=00 words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 
06=0000 07=0000
iic0: addr 0x49 48=00 words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 
06=0000 07=0000
iic0: addr 0x4a 48=00 words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 
06=0000 07=0000
iic0: addr 0x4b 48=00 words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 
06=0000 07=0000
iic0: addr 0x4c 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 48=00 
words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x4d 48=00 words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 
06=0000 07=0000
iic0: addr 0x4e 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 48=00 
words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
vga1 at pci0 dev 2 function 0 "Cirrus Logic CL-GD5446" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
em0 at pci0 dev 3 function 0 "Intel PRO/1000MT (82540EM)" rev 0x03: irq 11, 
address 52:54:00:27:21:96
"Qumranet Virtio Memory" rev 0x00 at pci0 dev 4 function 0 not configured
"Qumranet Virtio Console" rev 0x00 at pci0 dev 5 function 0 not configured
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com0: probed fifo depth: 0 bytes
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: density unknown
fd1 at fdc0 drive 1: density unknown
usb0 at uhci0: USB revision 1.0
uhub0 at usb0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
nvram: invalid checksum
mtrr: Pentium Pro MTRR support
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
root on wd0a swap on wd0b dump on wd0b
clock: unknown CMOS layout


>Release-Note:
>Audit-Trail:
>Unformatted:

Reply via email to