info-cvs
[Top][All Lists]
Advanced

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

Re: How to go back to the branch after mistakenly switching to the trunk


From: Mark D. Baushke
Subject: Re: How to go back to the branch after mistakenly switching to the trunk
Date: Sun, 04 Sep 2005 20:07:25 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ming Kin Lai <address@hidden> writes:

> I did not read carefully the documentation on "cvs commit -r REV" and
> made a mistake by committing a revision with a specified REV number on
> a branch.

Yeah, you should NEVER subvert internal cvs revision numbers unless you
are an expert... and then, you should know better than to do it.

> One cannot commit to a specific revision on a branch - and I did
> exactly that and now that revision is on the trunk.

Well, it is not impossible to do, you just never want to do it... and I
don't really want to tell you how to do it.

> Specifically, I made a tag on the trunk (let's say at revision 1.1)
> called "Root-of-Branch" before creating a branch called MyBranch using
> "cvs tag -b MyBranch". 

For future reference, you may find

   cvs rtag -b -rRoot-of-Branch MyBranch modulename

to be a 'better' way to create the branch in that it will typically also
create records in the CVSROOT/history file of the rtag commands and it
is sometimes desirable to know when you created a branch.

> Then I made some changes and tried to call it 2.1 by using
> "cvs commit -r 2.1". 

Ouch, bad idea.

> Well, this 2.1 is now on the trunck, not on the branch.

Yup, the mainline is now a 2.x series of numbers instead of a 1.x series
of numbers... but why do you care? You should never base anything on the
internal CVS version numbers in any case.

   cvs update -j2.1 -jRoot-of-Branch
   cvs commit

should get the mainline text to be what it was before your problem
commit... assuming that Root-of-Branch was still the top-of-tree
version prior to your problem commit.

> My question is: How can I go back on the branch so that my next
> revision is on the branch?

  cvs update -r MyBranch
  : ...modify the files you want to change
  cvs commit

> (Preferably, someone would tell me how to "move" that 2.1 to the branch?)  

The command:

  cvs admin -o2.1 filename

will delete the 2.1 revision from the filename. It is typically NOT
recommended, but if it is the top-of-tree revision, it should not be
a problem.

        -- Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFDG7ZtCg7APGsDnFERAtsZAJ4zk++OY8+yigRoFOs9CcXh3k0cXgCgyVGg
J5cPsfpeJ8wCeT9APlI0k+s=
=Ojyl
-----END PGP SIGNATURE-----




reply via email to

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