Differences between revisions 1 and 2
Revision 1 as of 2008-02-11 22:38:18
Size: 4081
Editor: WagnerBruna
Comment:
Revision 2 as of 2008-02-12 19:49:03
Size: 2525
Editor: WagnerBruna
Comment: cleaning up; reviewing phrasing
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
## still a draft

##== Tutorial - sharing a change with another repository ==
Line 10: Line 7:
##In TutorialFirstChange, we created a [:ChangeSet:changeset] in the {{{my-hello-new-output}}} [:Repository:repository]. Now we want to propagate that change somewhere else.
Line 13: Line 9:
##Following good Mercurial style, let's first [:Clone:clone] our original repository.
De acordo com o bom estilo do Mercurial, primeiramente vamos [:Clone:clonar] nosso repositório original.
De acordo com o bom estilo do Mercurial, primeiramente vamos fazer um [:Clone:clone] do nosso repositório original.
Line 21: Line 16:
##We can use the {{{tip}}} command to find out what the [:Tip:tip] in each repository is. (Remember, the tip is the most recent changeset.) We pass in the {{{-q}}} ("be quiet") option to keep Mercurial from printing a complete description of the tip.
Nós podemos usar o comando {{{tip}}} para determinar qual é a [:Tip:tip] em cada repositório. (Lembre-se, a tip é o changeset mais recente.) Nós passamos o parâmetro {{{-q}}} ("be quiet", ou "seja silencioso") para evitar que o Mercurial imprima uma descrição completa da tip.
Nós podemos usar o comando {{{tip}}} para determinar qual é a [:Tip:tip] em cada repositório (lembre-se, a tip é o changeset mais recente). Nós passamos o parâmetro {{{-q}}} ("be quiet", ou "seja silencioso") para evitar que o Mercurial imprima uma descrição completa da tip.
Line 33: Line 27:
##As we can see, the tip is different in each. Let's go back to {{{my-hello-share}}} and propagate our new changeset in there. To do this, we use the {{{pull}}} command, which [:Pull:pulls] all changesets that are in the other repository, but not yet in this one, into this one.
Como podemos notar, a tip é diferente em cada um. Vamos voltar ao {{{my-hello-share}}} e propagar nosso novo changeset para ele. Para fazer isso, nós usamos o comando {{{pull}}} , que [:Pull:puxa] todos os changesets que estão no outro repositório, mas ainda não estão neste, para este repositório aqui.
Como podemos notar, a tip é diferente em cada repositório. Vamos voltar ao {{{my-hello-share}}} e propagar nosso novo changeset para ele. Para fazer isso, nós usamos o comando {{{pull}}} , que faz o [:Pull:pull] (obtenção) de todos os changesets que estão no outro repositório, mas ainda não estão neste, para este repositório aqui.
Line 48: Line 41:
##Unlike other common mercurial commands, {{{pull}}} is chatty. In this case, the pull has succeeded.
Line 51: Line 43:
##The last line of output is important. By default, Mercurial does not update the [:WorkingDirectory:working directory] after a pull. This means that although the repository now contains the changeset, the file {{{hello.c}}} in the working directory still has its old pre-pull contents.
Line 54: Line 45:
##We can [:Update:update] this file (and any others that were changed during the pull) by following Mercurial's reminder:
Nós podemos fazer um [:Update:atualizar] este arquivo (e quaisquer outros que mudaram durante o pull) seguindo o lembrete do Mercurial:
Nós podemos fazer um [:Update:update] (atualização) deste arquivo (e quaisquer outros que mudaram durante o pull) seguindo o lembrete do Mercurial:
Line 62: Line 52:
##At this point, we can check and see that {{{my-hello-share}}} and {{{my-hello-new-output}}} have identical contents and revision histories.
Line 65: Line 54:
##To share a change with another person, we continue to TutorialExport.

Tutorial - compartilhando uma mudança com outro repositório

(This page in English: [:TutorialShareChange])

Em ../BrazilianPortugueseTutorialFirstChange, nós criamos um [:ChangeSet:changeset] no [:Repository:repositório] my-hello-new-output . Agora nós queremos propagar aquela mudança para algum outro lugar.

De acordo com o bom estilo do Mercurial, primeiramente vamos fazer um [:Clone:clone] do nosso repositório original.

$ cd ..
$ hg clone my-hello my-hello-share

Nós podemos usar o comando tip para determinar qual é a [:Tip:tip] em cada repositório (lembre-se, a tip é o changeset mais recente). Nós passamos o parâmetro -q ("be quiet", ou "seja silencioso") para evitar que o Mercurial imprima uma descrição completa da tip.

$ cd my-hello-share
$ hg -q tip
1:82e55d328c8c
$ cd ../my-hello-new-output
$ hg -q tip
2:a58809af174d

Como podemos notar, a tip é diferente em cada repositório. Vamos voltar ao my-hello-share e propagar nosso novo changeset para ele. Para fazer isso, nós usamos o comando pull , que faz o [:Pull:pull] (obtenção) de todos os changesets que estão no outro repositório, mas ainda não estão neste, para este repositório aqui.

$ cd ../my-hello-share
$ hg pull ../my-hello-new-output
pulling from ../my-hello-new-output
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)

Ao contrário de outros comandos comuns do Mercurial, pull é prolixo. Nesse caso, o pull terminou com sucesso.

A última linha da saída é importante. Por padrão, o Mercurial não atualiza o [:WorkingDirectory:diretório de trabalho] após um pull. Isso quer dizer que embora o repositório agora contenha o changeset, o arquivo hello.c no diretório de trabalho ainda tem seu conteúdo anterior ao pull.

Nós podemos fazer um [:Update:update] (atualização) deste arquivo (e quaisquer outros que mudaram durante o pull) seguindo o lembrete do Mercurial:

$ hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

Neste ponto, nós podemos verificar que my-hello-share e my-hello-new-output têm conteúdo e histórico de revisões idênticos.

Para compartilhar uma mudança com outra pessoa, nós continuaremos em ../BrazilianPortugueseTutorialExport.


CategoryTutorial

BrazilianPortugueseTutorialShareChange (last edited 2010-05-02 16:08:47 by WagnerBruna)