SVN checkout ignorar carpeta


¿Puedo ignorar una carpeta en svn checkout? Necesito ignorar la carpeta DOCs en el proceso de pago en mi servidor de compilación.

Editar: Ignorar externos no es una opción. Tengo algunos externos que necesito.

Author: Zoe, 2008-10-10

10 answers

No puede ignorar directamente las carpetas en un proceso de pago, pero puede usar cajas dispersas en svn 1.5. Por ejemplo:

$ svn co http://subversion/project/trunk my_checkout --depth immediates

Esto comprobará los archivos y directorios del tronco de su proyecto en 'my_checkout', pero no recurse a esos directorios. Eg:

$ cd my_checkout && ls
bar/ baz foo xyzzy/

Luego para obtener el contenido de' bar':

$ cd bar && svn update --set-depth infinity
 99
Author: Jon Topper,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-10-20 11:44:29

Sí puede usar SVN 1.6. Tendrá que hacer un pago primero, luego marcar la carpeta para la exclusión y luego eliminar la carpeta no deseada.

svn checkout http://www.example.com/project
cd project
svn update --set-depth=exclude docs
rm -fr docs

A partir de ahora, cualquier actualización de la copia de trabajo no repoblará la carpeta docs.

Véase http://blogs.collab.net/subversion/2009/03/sparse-directories-now-with-exclusion / y http://subversion.apache.org/docs/release-notes/1.6.html#sparse-directory-exclusion para más detalles.

Tom

 74
Author: tommy_turrell,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-12-09 14:03:05

Con versiones anteriores a la 1.5, he encontrado que si realiza solo la carpeta superior y luego actualiza selectivamente, a partir de entonces las actualizaciones solo afectan lo que ha retirado. IE.

svn co -N foo
cd foo
svn up -N bar
svn up

El indicador-N hace que la operación no sea recursiva. Lo anterior no comprobará nada más en el nivel foo, por ejemplo. digamos que hay una carpeta lala, el svn final no revisará esa carpeta, pero se actualizará bar.

Pero en un momento posterior se puede svn up lala y por lo tanto, añadir a la Checkout.

Presumiblemente esto también funciona con 1.5.

 9
Author: mxcl,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-10-20 11:54:42

Esto está en el cliente TortoiseSVN 1.7.1 (podría estar disponible también en algunas versiones anteriores):

  • SVN checkout Select > Seleccionar URL del repositorio

  • Haga clic en "Elementos de pago" (en Profundidad de pago) y seleccione solo el se requieren carpetas!

 5
Author: gammay,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-08-31 04:55:51

Puede poner la carpeta docs en un repositorio externo y luego usar svn checkout --ignore-externals.

 4
Author: John Millikin,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-10-10 19:57:00

Sí, Subversion 1.5 tiene una característica llamada Sparse checkouts que puede hacer exactamente este tipo de cosas.

 4
Author: Greg Hewgill,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-07-29 09:44:57

Encontré esta pregunta buscando una manera de revisar las fuentes de WebKit mientras excluía las pruebas de regresión. Terminé con lo siguiente:

svn checkout http://svn.webkit.org/repository/webkit/trunk WebKit \
  --depth immediates

cd WebKit
find . \
  -maxdepth 1 -type d \
  -not -name '.*' \
  -not -name '*Tests' \
  -not -name 'Examples' \
  -not -name 'Websites' \
  | (while read SUBDIR; do svn update --set-depth infinity "$SUBDIR"; done)

Tenga en cuenta que puede cambiar las exclusiones como mejor le parezca, pero .* se recomienda omitir el directorio de trabajo (que ya está actualizado) y todo el .directorios svn.

 3
Author: rgov,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-08-12 05:39:33

Recientemente he resuelto la misma tarea. La idea es obtener la lista inmediata de carpetas/archivos bajo el repositorio excluya las entradas que necesita, luego revise las carpetas restantes y actualice los archivos inmediatos si los hay. Aquí está la solución:

    # Path to the svn repository to be checked out
rpath=https://svn-repo.company.com/sw/trunk/ && \
    # This files are to be excluded (folders are ending with '/')
    # this is a regex pattern with OR ('|') between enties to be excluded
excludep='docs_folder/tests_folder/|huge_folder/|file1|file2' && \
    # Get list of the files/folders right under the repository path
filtered=`svn ls $rpath | egrep -v $excludep` && \
    # Get list of files out of filtered - they need to be 'uped'
files=`echo $filtered | sed 's| |\n|g' | egrep '^.*[^/]$'` && \
    # Get list of folders out of filtered - they need to be 'coed'
folders=`echo $filtered | sed 's| |\n|g' | egrep '^.*[/]$'` && \
    # Initial nonrecursive checkout of repository - just empty
    # to the current (./) working directory
svn co $rpath ./ --depth empty && \
    # Update the files
svn up $files &&\
    # Check out the all other folders finally.
svn co `echo $folders | sed "s|\<|$rpath|g"`

Cambie al directorio de trabajo de origen. Copie los comandos. Pegar. Cambie la URL apropiada y excluya el patrón. Ejecuta el comando.

Gracias,

 2
Author: bv.,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-02-13 20:11:13

No, ignorar es solo para agregar archivos.
Puede usar cheques dispersos (si usa svn 1.5)

 1
Author: Peter Parker,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-10-10 19:56:03

Como algunos otros han mencionado, puede usar las propiedades svn:externals y luego la opción ignore ignore-externals cuando realice el pago. Una cosa a tener en cuenta, sin embargo, es que svn:externals hace no necesariamente necesita referirse a otro repositorio. Puede ser una referencia a alguna otra carpeta en el mismo repositorio.

 1
Author: Nik Reiman,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-10-13 09:26:05