comparison es/concepts.tex @ 521:59fbfb7e790c

translated some more comments
author Javier Rojas <jerojasro@devnull.li>
date Mon, 17 Nov 2008 20:04:37 -0500
parents 0774efad9003
children f907df38efef
comparison
equal deleted inserted replaced
520:93bd78a98b78 521:59fbfb7e790c
337 verse en la figura~\ref{fig:concepts:wdir-after-commit}. Mercurial no 337 verse en la figura~\ref{fig:concepts:wdir-after-commit}. Mercurial no
338 toca ninguno de los ficheros del directorio de trabajo cuando usted 338 toca ninguno de los ficheros del directorio de trabajo cuando usted
339 hace la consignación; sólo modifica el estado de directorio para 339 hace la consignación; sólo modifica el estado de directorio para
340 anotar sus nuevos padres. 340 anotar sus nuevos padres.
341 341
342 \subsection{Creating a new head} 342 \subsection{Creación de un nuevo frente}
343 343
344 It's perfectly normal to update the working directory to a changeset 344 Es perfectamente normal actualizar el directorio de trabajo a un
345 other than the current tip. For example, you might want to know what 345 conjunto de cambios diferente a la punta actual. Por ejemplo, usted
346 your project looked like last Tuesday, or you could be looking through 346 podría desear saber en qué estado se encontraba su proyecto el martes
347 changesets to see which one introduced a bug. In cases like this, the 347 pasado, o podría estar buscando en todos los conjuntos de cambios para
348 natural thing to do is update the working directory to the changeset 348 saber cuándo se introdujo un fallo. En casos como éstos, la acción
349 you're interested in, and then examine the files in the working 349 natural es actualizar el directorio de trabajo al conjunto de cambios
350 directory directly to see their contents as they werea when you 350 de su interés, y examinar directamente los ficheros en el directorio
351 committed that changeset. The effect of this is shown in 351 de trabajo para ver sus contenidos tal como estaban en el momento de
352 figure~\ref{fig:concepts:wdir-pre-branch}. 352 hacer la consignación. El efecto que tiene esto se muestra en la
353 figura~\ref{fig:concepts:wdir-pre-branch}.
353 354
354 \begin{figure}[ht] 355 \begin{figure}[ht]
355 \centering 356 \centering
356 \grafix{wdir-pre-branch} 357 \grafix{wdir-pre-branch}
357 \caption{The working directory, updated to an older changeset} 358 \caption{El directorio de trabajo, actualizado a un conjunto de
359 cambios anterior}
358 \label{fig:concepts:wdir-pre-branch} 360 \label{fig:concepts:wdir-pre-branch}
359 \end{figure} 361 \end{figure}
360 362
361 Having updated the working directory to an older changeset, what 363 Una vez se ha actualizado el directorio de trabajo a un conjunto de
362 happens if you make some changes, and then commit? Mercurial behaves 364 cambios anterior, qué pasa si se hacen cambios, y luego se hace una
363 in the same way as I outlined above. The parents of the working 365 consignación? Mercurial se comporta en la misma forma que describí
364 directory become the parents of the new changeset. This new changeset 366 anteriormente. Los padres del directorio de trabajo se convierten en
365 has no children, so it becomes the new tip. And the repository now 367 los padres del nuevo conjunto de cambios. Este nuevo conjunto de
366 contains two changesets that have no children; we call these 368 cambios no tiene hijos, así que se convierte en la nueva punta. Y el
367 \emph{heads}. You can see the structure that this creates in 369 repositorio tiene ahora dos conjuntos de cambios que no tienen hijos;
368 figure~\ref{fig:concepts:wdir-branch}. 370 a éstos los llamamos \emph{frentes}. Usted puede apreciar la
371 estructura que esto crea en la figura~\ref{fig:concepts:wdir-branch}.
369 372
370 \begin{figure}[ht] 373 \begin{figure}[ht]
371 \centering 374 \centering
372 \grafix{wdir-branch} 375 \grafix{wdir-branch}
373 \caption{After a commit made while synced to an older changeset} 376 \caption{Después de una consignación hecha mientras se usaba un
377 conjunto de cambios anterior}
374 \label{fig:concepts:wdir-branch} 378 \label{fig:concepts:wdir-branch}
375 \end{figure} 379 \end{figure}
376 380
377 \begin{note} 381 \begin{note}
378 If you're new to Mercurial, you should keep in mind a common 382 Si usted es nuevo en Mercurial, debería tener en mente un
379 ``error'', which is to use the \hgcmd{pull} command without any 383 ``error'' común, que es usar el comando \hgcmd{pull} sin ninguna
380 options. By default, the \hgcmd{pull} command \emph{does not} 384 opción. Por defecto, el comando \hgcmd{pull} \emph{no} actualiza
381 update the working directory, so you'll bring new changesets into 385 el directorio de trabajo, así que usted termina trayendo nuevos
382 your repository, but the working directory will stay synced at the 386 conjuntos de cambios a su repositorio, pero el directorio de
383 same changeset as before the pull. If you make some changes and 387 trabajo sigue usando el mismo conjunto de cambios que tenía antes
384 commit afterwards, you'll thus create a new head, because your 388 de jalar. Si usted hace algunos cambios, y luego hace una
385 working directory isn't synced to whatever the current tip is. 389 consignación, estará creando un nuevo frente, porque su directorio
386 390 de trabajo no es sincronizado a cualquiera que sea la nueva punta.
387 I put the word ``error'' in quotes because all that you need to do 391
388 to rectify this situation is \hgcmd{merge}, then \hgcmd{commit}. In 392 Pongo la palabra ``error'' en comillas porque todo lo que usted
389 other words, this almost never has negative consequences; it just 393 debe hacer para rectificar la situación es hacer una fusión
390 surprises people. I'll discuss other ways to avoid this behaviour, 394 (\hgcmd{merge}), y luego una consignación (\hgcmd{commit}). En
391 and why Mercurial behaves in this initially surprising way, later 395 otras palabras, esto casi nunca tiene consecuencias negativas;
392 on. 396 sólo sorprende a la gente. Discutiré otras formas de evitar este
397 comportamiento, y porqué Mercurial se comporta de esta forma,
398 inicialmente sorprendente, más adelante.
393 \end{note} 399 \end{note}
394 400
395 \subsection{Merging heads} 401 \subsection{Fusión de frentes}
396 402
397 When you run the \hgcmd{merge} command, Mercurial leaves the first 403 Cuando usted ejecuta el comando \hgcmd{merge}, Mercurial deja el
398 parent of the working directory unchanged, and sets the second parent 404 primer padre del directorio de trabajo intacto, y escribe como segundo
399 to the changeset you're merging with, as shown in 405 padre el conjunto de cambios contra el cual usted está haciendo la
400 figure~\ref{fig:concepts:wdir-merge}. 406 fusión, como se muestra en la figura~\ref{fig:concepts:wdir-merge}.
401 407
402 \begin{figure}[ht] 408 \begin{figure}[ht]
403 \centering 409 \centering
404 \grafix{wdir-merge} 410 \grafix{wdir-merge}
405 \caption{Merging two heads} 411 \caption{Fusión de dos frentes}
406 \label{fig:concepts:wdir-merge} 412 \label{fig:concepts:wdir-merge}
407 \end{figure} 413 \end{figure}
408 414
409 Mercurial also has to modify the working directory, to merge the files 415 Mercurial también debe modificar el directorio de trabajo, para
410 managed in the two changesets. Simplified a little, the merging 416 fusionar los ficheros que él monitorea en los dos conjuntos de
411 process goes like this, for every file in the manifests of both 417 cambios. Con algunas simplificaciones, el proceso es el siguiente, por
412 changesets. 418 cada fichero en los manifiestos de ambos conjuntos de cambios.
413 \begin{itemize} 419 \begin{itemize}
414 \item If neither changeset has modified a file, do nothing with that 420 \item Si ningún conjunto de cambios ha modificado un fichero, no se
415 file. 421 hace nada con el mismo.
416 \item If one changeset has modified a file, and the other hasn't, 422 \item Si un conjunto de cambios ha modificado un fichero, y el otro no
417 create the modified copy of the file in the working directory. 423 lo ha hecho, se crea una copia del fichero con las modificaciones
418 \item If one changeset has removed a file, and the other hasn't (or 424 pertinentes en el directorio de trabajo.
419 has also deleted it), delete the file from the working directory. 425 \item Si un conjunto de cambios borra un fichero, y el otro no lo ha
420 \item If one changeset has removed a file, but the other has modified 426 hecho (o también lo borró), se borra dicho fichero del directorio
421 the file, ask the user what to do: keep the modified file, or remove 427 de trabajo.
422 it? 428 \item Si un conjunto de cambios ha borrado un fichero, pero el otro lo ha
423 \item If both changesets have modified a file, invoke an external 429 modificado, se le pregunta al usuario qué hacer: conservar el
424 merge program to choose the new contents for the merged file. This 430 fichero modificado, o borrarlo?
425 may require input from the user. 431 \item Si ambos conjuntos de cambios han modificado un fichero, se
426 \item If one changeset has modified a file, and the other has renamed 432 invoca el programa externo de fusión para definir el nuevo
427 or copied the file, make sure that the changes follow the new name 433 contenido del fichero fusionado. Esto puede requerir interacción
428 of the file. 434 directa de parte del usuario.
435 \item Si un conjunto de cambios ha modificado un fichero, y el otro ha
436 renombrado o copiado el mismo, asegurarse de que los cambios sigan
437 al nuevo nombre de fichero.
429 \end{itemize} 438 \end{itemize}
430 There are more details---merging has plenty of corner cases---but 439 Hay más detalles---hacer una fusión tiene una gran cantidad de casos
431 these are the most common choices that are involved in a merge. As 440 especiales---pero éstas son las elecciones más comunes que se ven
432 you can see, most cases are completely automatic, and indeed most 441 involucradas en una fusión. Como usted puede ver, muchos de los casos
433 merges finish automatically, without requiring your input to resolve 442 son completamente automáticos, y de hecho la mayoría de las fusiones
434 any conflicts. 443 terminan automáticamente, sin requerir la interacción del usuario para
444 resolver ningún conflicto.
435 445
436 When you're thinking about what happens when you commit after a merge, 446 When you're thinking about what happens when you commit after a merge,
437 once again the working directory is ``the changeset I'm about to 447 once again the working directory is ``the changeset I'm about to
438 commit''. After the \hgcmd{merge} command completes, the working 448 commit''. After the \hgcmd{merge} command completes, the working
439 directory has two parents; these will become the parents of the new 449 directory has two parents; these will become the parents of the new