Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2009-04-25 18:17:21
Size: 2701
Editor: SergeySign
Comment:
Revision 3 as of 2009-05-19 19:31:03
Size: 3556
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
''(Это 5-я из 9-ти частей[:RussianTutorial:Tutorial]. Предыдущая - [:RussianTutorialFirstChange:Создание первого изменения], Следующая - [:RussianTutorialExport])'' ''(Это 5-я из 9-ти частей[[RussianTutorial|Tutorial]]. Предыдущая - [[RussianTutorialFirstChange|Создание первого изменения]], Следующая - [[RussianTutorialExport]])''
Line 5: Line 5:
В [:RussianTutorialFirstChange:Создание первого изменения], мы создали [:ChangeSet:changeset] в [:Repository:репозитории] `my-hello-new-output`. В [[RussianTutorialFirstChange|Создание первого изменения]], мы создали [[ChangeSet|changeset]] в [[Repository|репозитории]] `my-hello-new-output`.
Line 8: Line 8:
Следуя стилю Mercurial, сначала [:Clone:клонируем] оригинальный репозиторий. Следуя стилю Mercurial, сначала [[Clone|клонируем]] оригинальный репозиторий.
Line 17: Line 17:
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. Мы можем использовать команду `tip` что бы найти [[Tip|tip]] в каждом репозитории. (Tip это самый последний changeset.) Мы укажем опцию `-q` ("be quiet" - "быть безшумным" ) что бы Mercurial не выводил полное описание tip'а.
Line 28: Line 28:
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. Как мы можем увидеть, tip'ы отличаются. Возвращаемся в `my-hello-share` и копируем в него changeset'ы. Что бы сделать это, мы используем команду `pull`, которая [[Pull|подтягивает]] все changeset'ы из другого репозитория в текущий репозиторий. Заметьте, именно из другого репозитория.
Line 42: Line 42:
Unlike other common Mercurial commands, `pull` is chatty. In this case, the pull has succeeded. В отличие от других команд Mercurial'а, `pull` очень болтлива. В данном случае подтягивание было успешным.
Line 44: Line 44:
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. Последняя строка вывода важна. По умолчанию Mercurial не обновляет [[WorkingDirectory|рабочий каталог]] после pull'а. Это означает, что, хотя в репозитории в настоящее время содержатся подтянутый changeset, содержимое файла `hello.c` в рабочем каталоге осталось таким же как и до pull'а.
Line 46: Line 46:
We can [:Update:update] this file (and any others that were changed during the pull) by following Mercurial's reminder (we use the abbreviation `up`): Мы можем обновить этот файл (как и другие изменившиеся при извлечении изменений) командой `[:Update:update]` (либо используя сокращение `up`):
Line 53: Line 53:
At this point, we can check and see that `my-hello-share` and `my-hello-new-output` have identical contents and revision histories. На этой стадии, мы можем посмотреть и убедиться в том что у репозитариев `my-hello-share` и `my-hello-new-output` одинаковый контент и истории ревизий.
Line 55: Line 55:
To share a change with another person, we continue to [:TutorialExport]. Предоставлением изменений кому-нибудь ещё мы займёмся в [[RussianTutorialExport]].

Tutorial - обмен изменениями с другим репозиторием

(Это 5-я из 9-ти частейTutorial. Предыдущая - Создание первого изменения, Следующая - RussianTutorialExport)

В Создание первого изменения, мы создали changeset в репозитории my-hello-new-output. Теперь мы хотим публиковать изменения в других местах.

Следуя стилю Mercurial, сначала клонируем оригинальный репозиторий.

$ cd ..
$ hg clone my-hello my-hello-share
updating working directory
2 files updated, 0 files merged, 0 files removed, 0 files unresolved

Мы можем использовать команду tip что бы найти tip в каждом репозитории. (Tip это самый последний changeset.) Мы укажем опцию -q ("be quiet" - "быть безшумным" ) что бы Mercurial не выводил полное описание tip'а.

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

Как мы можем увидеть, tip'ы отличаются. Возвращаемся в my-hello-share и копируем в него changeset'ы. Что бы сделать это, мы используем команду pull, которая подтягивает все changeset'ы из другого репозитория в текущий репозиторий. Заметьте, именно из другого репозитория.

$ 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)

В отличие от других команд Mercurial'а, pull очень болтлива. В данном случае подтягивание было успешным.

Последняя строка вывода важна. По умолчанию Mercurial не обновляет рабочий каталог после pull'а. Это означает, что, хотя в репозитории в настоящее время содержатся подтянутый changeset, содержимое файла hello.c в рабочем каталоге осталось таким же как и до pull'а.

Мы можем обновить этот файл (как и другие изменившиеся при извлечении изменений) командой [:Update:update] (либо используя сокращение up):

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

На этой стадии, мы можем посмотреть и убедиться в том что у репозитариев my-hello-share и my-hello-new-output одинаковый контент и истории ревизий.

Предоставлением изменений кому-нибудь ещё мы займёмся в RussianTutorialExport.


CategoryTutorial CategoryRussian

RussianTutorialShareChange (last edited 2012-08-13 20:27:28 by 94-153-226-116-kv)