CVS fetch the branch name with a tag name - Linux

This is a discussion on CVS fetch the branch name with a tag name - Linux ; Hi, If I have a branch B_1 with revision 1.2.1.1 and have a tag T_1 in 1.2.1.3, which is under the branch B_1. How can I know the tag T_1's branch name using CVS command? What I want to achieve ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: CVS fetch the branch name with a tag name

  1. CVS fetch the branch name with a tag name

    Hi,

    If I have a branch B_1 with revision 1.2.1.1 and have a tag T_1 in
    1.2.1.3, which is under the branch B_1. How can I know the tag T_1's
    branch name using CVS command?

    What I want to achieve is, when I know a tag name T_1 for a module, I
    want to check out the T_1 tag, then edit it, then commit it to the
    branch B_1.

    If I am using:

    cvs up -r T_1

    Then after editing, I commit, the cvs will say the tag is uneditable!

    How to do this?

    Thanks
    Bin


  2. Re: CVS fetch the branch name with a tag name

    Bin Chen writes:

    > If I have a branch B_1 with revision 1.2.1.1 and have a tag T_1 in
    > 1.2.1.3, which is under the branch B_1. How can I know the tag T_1's
    > branch name using CVS command?
    >
    > What I want to achieve is, when I know a tag name T_1 for a module, I
    > want to check out the T_1 tag, then edit it, then commit it to the
    > branch B_1.


    Branches are linear in CVS. So if you want to commit to branch B_1,
    you must commit to the head of B_1 (whether that happens to be T_1 or
    not).

    So the only way you can commit to B_1 is to check out the branch B_1:

    cvs update -r B_1

    If you want to replace the head of B_1 with some edited version of
    what's at T_1, you could check out T_1 somewhere else and copy over
    the files.

    Or do "cvs diff -r T_1 | patch -p0 -R" to patch your B_1 checkout back
    to T_1. Or use "cvs update" to do the same (I forget the exact way to
    do that: something like "cvs update -j B_1 -j T_1").

  3. Re: CVS fetch the branch name with a tag name

    On Jun 21, 6:39 am, Bruce Stephens
    wrote:
    > Bin Chen writes:
    > > If I have a branch B_1 with revision 1.2.1.1 and have a tag T_1 in
    > > 1.2.1.3, which is under the branch B_1. How can I know the tag T_1's
    > > branch name using CVS command?

    >
    > > What I want to achieve is, when I know a tag name T_1 for a module, I
    > > want to check out the T_1 tag, then edit it, then commit it to the
    > > branch B_1.

    >
    > Branches are linear in CVS. So if you want to commit to branch B_1,
    > you must commit to the head of B_1 (whether that happens to be T_1 or
    > not).
    >
    > So the only way you can commit to B_1 is to check out the branch B_1:
    >
    > cvs update -r B_1
    >
    > If you want to replace the head of B_1 with some edited version of
    > what's at T_1, you could check out T_1 somewhere else and copy over
    > the files.
    >
    > Or do "cvs diff -r T_1 | patch -p0 -R" to patch your B_1 checkout back
    > to T_1. Or use "cvs update" to do the same (I forget the exact way to
    > do that: something like "cvs update -j B_1 -j T_1").


    Can I know a tag's branch name thru a CVS command?


  4. Re: CVS fetch the branch name with a tag name

    Bin Chen wrote:

    > Can I know a tag's branch name thru a CVS command?
    >


    I don't know if you can get the branch's name thru a CVS command, but have a
    look on the CVS/ directory that is created when you checkout a project.
    Inside, you can find a bunch of files with some useful information.


    --
    SF

    "Spartani... mangiate tanto a colazione perchè stasera ceneremo nell'Ade!!"

  5. Re: CVS fetch the branch name with a tag name

    Bin Chen writes:

    [...]

    > Can I know a tag's branch name thru a CVS command?


    I don't think there's an especially easy way. Use "cvs log" on a
    file, and you'll see all the symbols used in that file. It's possible
    to determine from that the name of the branch that a tag is on (for
    that file, if the branch has a name).

    It should be reasonably obvious which one it is: you're looking for a
    branch name that has a revision that's close to the same as the tag
    except for the last two components. The second to last component will
    be a 0. (Except for vendor branches which always confuse me.)

+ Reply to Thread