your excuse: Communications satellite used by the military for star wars.
CoffMan Weblog Linux category Java category wiki Image thx to Chenchu Ricochet Robot J2MESimon Says J2ME gameCoffMan WeblogJava stuffLinux stuffImage thx to ChenchuWickleMarihuana Category
   Victor Fariña Infante , info about my own projects and thoughts.
 
login



.:¿?-_-¿?:.
Anton tiene




Powered by

 



Technology, Java, thoughts and projects of Coffman, host of wickle dot com. feel free to make comments.
[Sep 21, 2007]

El tortoiseSVN es un programa para Windows que añade acciones relativas al Subversion al menú contextual, por ejemplo "SVN Commit" ó "SVN Update", de modo que para realizar un Update o un Commit unicamente seleccionamos la carpeta o el archivo , botón derecho y ejecutamos ... Extremadamente sencillo !!! Me encanta ;)
Hasta ahora este era un privilegio de los usuarios de Windows, hace poco he descubierto como implementar esto mismo en Linux, necesitaremos el zenity (para los dialogos), el nautilus-actions (que se instala mediante apt-get fácilmente) y los 2 scripts que anexo (obtenidos de nautilus-scripts) y los 2 iconos que anexo (sacados del tema tango-blue-materia)
La idea es crear 2 acciones nuevas dentro del menu contextual, para ello ejecutamos el nautilus-action-config y creamos las nuevas acciones con las siguientes propiedades:
=======================
SVN Commit
Icon: /home/vic/fondos/iconos/edit-redo.png
Path: /home/vic/.scripts/Subversion/Commit
Parameters: %d/%m
File Pattern: *
Folders/Files: Both
Multiple: unchecked
=======================

=======================
SVN Update
Icon: /home/vic/fondos/iconos/edit-undo.png
Path: /home/vic/.scripts/Subversion/Update
Parameters: %d/%m
File Pattern: *
Folders/Files: Both
Multiple: checked
=======================

Creamos los siguientes scripts:
/home/vic/.scripts/Subversion/Commit :

#!/bin/sh
#
# Distributed under the terms of GNU GPL version 2
#
# http://marius.scurtescu.com/?p=102

LOGFILE=`mktemp -t svn_commit.XXXXXX`

ICONPATH="`dirname $0`/svn.xpm"
LOGMESSAGE=`zenity --entry --title="Subversion: Commit" --text="Enter log message:" --width=400 --window-icon="$ICONPATH" 2>&1`

if [ $? -eq 0 ] ; then
    svn commit -m "$LOGMESSAGE" "$@" > $LOGFILE
    cat $LOGFILE | zenity --text-info --title="Subversion: Commit" --width=600 --height=400 --window-icon="`dirname $0`/svn.xpm"
    rm -f $LOGFILE
fi

y el scripts para el Update /home/vic/.scripts/Subversion/Update :

#!/bin/sh
#
# Distributed under the terms of GNU GPL version 2
#
# http://marius.scurtescu.com/?p=102

LOGFILE=`mktemp -t svn_update.XXXXXX`

svn update "$@" > $LOGFILE
#zenity --text-info --title="Subversion: Update" --filename=$LOGFILE --width=600 --height=400 --window-icon="`dirname $0`/svn.xpm"
# Se sustituye la linea de arriba (que es la original) por la de abajo para evitar el error que da con las locales
cat $LOGFILE | zenity --text-info --title="Subversion: Update" --width=600 --height=400 --window-icon="`dirname $0`/svn.xpm"
rm -f $LOGFILE


Este es el resultado final:



Implementar el resto de acciones del Subversion es sencillo, lo dejo a vuestra imaginación ;)
Referencias:



by coffman - 13:01:11 |



CoffMan Site


Since July 2002
Victor Fariña Infante (aka CoffMan) creator of wIckle.com