bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug: cvs diff -rHEAD does not always refer to head of trunk


From: Jim.Hyslop
Subject: Bug: cvs diff -rHEAD does not always refer to head of trunk
Date: Thu, 3 Jul 2003 15:54:28 -0400

cvs version: 1.11.5 (client/server)

The -rHEAD option for cvs diff refers to the head of the current branch,
rather than the latest trunk revision. The following sequence of commands
illustrates the problem:

echo Hello > hello.txt
cvs add hello.txt
cvs ci -m "Initial add" hello.txt
cvs tag base_tag hello.txt
cvs tag -b branch_tag hello.txt
echo World >> hello.txt
cvs ci -m "Trunk change" hello.txt
cvs up -r branch_tag hello.txt
echo There >> hello.txt
cvs ci -m "Branch changes" hello.txt
cvs di -rbase_tag -rHEAD hello.txt
cvs log -rHEAD hello.txt
cvs up -A
cvs di -rbase_tag -rHEAD hello.txt
cvs log -rHEAD hello.txt

The output of the last five commands is:
D:\files\cvs\cvs-test\jhyslop>cvs di -rbase_tag -rHEAD hello.txt
Index: hello.txt
===================================================================
RCS file: /cvs/cvs-test/jhyslop/hello.txt,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -r1.1 -r1.1.2.1
1a2
> There

D:\files\cvs\cvs-test\jhyslop>cvs log -rHEAD hello.txt

RCS file: /cvs/cvs-test/jhyslop/hello.txt,v
Working file: hello.txt
head: 1.2
branch:
locks: strict
access list:
symbolic names:
        branch_tag: 1.1.0.2
        base_tag: 1.1
keyword substitution: kv
total revisions: 3;     selected revisions: 1
description:
----------------------------
revision 1.2
date: 2003/07/03 19:24:50;  author: jhyslop;  state: Exp;  lines: +1 -0
Trunk change
============================================================================
=

D:\files\cvs\cvs-test\jhyslop>cvs up -A
cvs server: Updating .
U hello.txt

D:\files\cvs\cvs-test\jhyslop>cvs di -rbase_tag -rHEAD hello.txt
Index: hello.txt
===================================================================
RCS file: /cvs/cvs-test/jhyslop/hello.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -r1.1 -r1.2
1a2
> World

D:\files\cvs\cvs-test\jhyslop>cvs log -rHEAD hello.txt

RCS file: /cvs/cvs-test/jhyslop/hello.txt,v
Working file: hello.txt
head: 1.2
branch:
locks: strict
access list:
symbolic names:
        branch_tag: 1.1.0.2
        base_tag: 1.1
keyword substitution: kv
total revisions: 3;     selected revisions: 1
description:
----------------------------
revision 1.2
date: 2003/07/03 19:24:50;  author: jhyslop;  state: Exp;  lines: +1 -0
Trunk change
============================================================================
=


This behaviour is inconsistent with other commands - other commands use HEAD
to mean "the latest trunk revision". When working from a branch, the
following commands all refer to rev 1.2:
  cvs log -rHEAD
  cvs up -rHEAD
  cvs up -jHEAD
  cvs annotate -rHEAD
  cvs tag -rHEAD

Most importantly, `HEAD' is the only way to symbolically refer to the head
of the trunk. You can refer to the head of a branch by specifying the
symbolic branch tag.

-- 
Jim Hyslop
Senior Software Designer
Leitch Technology International Inc. (http://www.leitch.com)
Columnist, C/C++ Users Journal (http://www.cuj.com/experts)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]