miércoles, abril 28, 2004

CVS - Como eliminar una revisi?n que hemos subido al repositorio por equivocacion


El tema surgio como consecuencia de una mu?onada, de una compi de proyecto. Mirando en la documentaci?n del CVS no vi ning?n punto al respecto, por lo que le pregunte a JJ. A continuaci?n va el correo:


Unnn

Si haces eso, y no recuerdo yo mal te va a dar problemas, porque el fija una historia que te impide hacer commit despu?s, las opciones pasan por hacer una rama con eso, o la cutre de la muerte que te explico a continuaci?n:

cvs commit -m"Fichero chungo que con el que me voy a equivocar" MiFichero.C
# La hemos cagado y miramos que version tiene el fichero ahora tras subirlo
cvs status -v MiFichero.C
# Resulta que nos dice que es la release 1.2, por poner un ejemplo y sabemos que la 1.1 esta bien
cvs checkout -p -r 1.1 MiFichero.C > MiFichero.r1.1.C
mv -f MiFichero.r1.1.C MiFichero.C
cvs update
# Nos lo tiene que marcar como que se encuentra modificado localmente
cvs commit -m"Ahora queda todo bien otra vez" MiFichero.C

Salu2 Javi

PD: Existe otra opci?n que es lo que tu dices mas a la hora de hacer el commit se hace cvs commit -A -m"Sin stickness"

Cesar Ortiz wrote:
?Se puede eliminar una release que has subido por error al repositorio?

No he visto en la documentacion que se pueda hacer directamente.

En caso contrario lo mas sencillo seria:
+ hacer un update de la release anterior
+ hacer un commit de esa release anterior

?no?


Posteriormente vi que en la doc si que comentaban cosillas en:



5.8 Merging di erences between any two revisions
With two ‘-j revision’ flags, the update (and checkout) command can merge the differences
between any two revisions into your working file.
$ cvs update -j 1.5 -j 1.3 backend.c
will undo all changes made between revision 1.3 and 1.5. Note the order of the revisions!
If you try to use this option when operating on multiple files, remember that the numeric
revisions will probably be very di erent between the various files. You almost always use
symbolic tags rather than revision numbers when operating on multiple files.
Specifying two ‘-j’ options can also undo file removals or additions. For example, suppose
you have a file named ‘file1’ which existed as revision 1.1, and you then removed it (thus
adding a dead revision 1.2). Now suppose you want to add it again, with the same contents
it had previously. Here is how to do it:
$ cvs update -j 1.2 -j 1.1 file1
U file1
$ cvs commit -m test
Checking in file1;
/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
new revision: 1.3; previous revision: 1.2
done
$


Y del apartado 4.9 sobre Sticky tags:


People often want to retrieve an old version of a file without setting a sticky tag. This
can be done with the ‘-p’ option to checkout or update, which sends the contents of the
file to standard output. For example:
$ cvs update -p -r 1.1 file1 >file1
===================================================================
Checking out file1
RCS: /tmp/cvs-sanity/cvsroot/first-dir/Attic/file1,v
VERS: 1.1
***************
$
However, this isn’t the easiest way, if you are asking how to undo a previous checkin (in
this example, put ‘file1’ back to the way it was as of revision 1.1). In that case you are
better o using the ‘-j’ option to update; for further discussion see Section 5.8 [Merging
two revisions], page 48.

No hay comentarios: