Bazaar/Bazaar 5ºÐ °ÀÇ
Bazaar/Bazaar 5ºÐ °ÀÇ
ÀÌ ÆäÀÌÁö´Â Bazaar in five minutes (2007-12-13) ¸¦ ¹ø¿ªÇÑ °ÍÀÔ´Ï´Ù.
Contents
1. ¼Ò°³ ¶Bazaar´Â ºÐ»êÇü ¹öÀü °ü¸® ½Ã½ºÅÛ(distributed version control system)À¸·Î
¼ÒÇÁÆ®¿þ¾î ÇÁ·ÎÁ§Æ® °øµ¿ ÀÛ¾÷À» ½±°Ô ÇÒ ¼ö ÀÖµµ·Ï ÇØ ÁÝ´Ï´Ù.
ÀÌÁ¦ºÎÅÍ 5ºÐ µ¿¾È ¾î¶»°Ô ÆÄÀϵéÀ» ¹öÀü °ü¸® ¾Æ·¡ ³Ö°í, º¯°æ »çÇ×À» ±â·ÏÇÏ°í,
ÀÛ¾÷À» °Ë»çÇÏ°í, ¿Â¶óÀÎ »ó¿¡ ÃâÆÇ(publish)ÇÏ°í, ÀÚ½ÅÀÇ ÀÛ¾÷À» ÇÁ·ÎÁ§Æ®ÀÇ ÁÙ±â(trunk)¿¡
º´ÇÕ(merge)ÇÒ ¼ö ÀÖ´ÂÁö ¹è¿öº¸°Ú½À´Ï´Ù.
2. ¼³Ä¡ ¶ÀÌ ¾È³»¼´Â ¼³Ä¡ÇÏ´Â ¹æ¹ýÀ» ¼³¸íÇÏÁö´Â ¾ÊÀ» °ÍÀÔ´Ï´Ù. ¼³Ä¡´Â ¾ÆÁÖ ½±½À´Ï´Ù. ¼³Ä¡¿¡ °üÇÑ
¼³¸íÀº ´ÙÀ½ ÆäÀÌÁöµéÀ» ÂüÁ¶Çϼ¼¿ä:
3. »ç¿ëÀÚ ¼³Á¤ ¶ÀÛ¾÷À» ½ÃÀÛÇϱâ Àü¿¡ Bazaar¿¡°Ô ÀÚ½ÅÀÌ ´©±¸ÀÎÁö ¾Ë·ÁÁÖ´Â °ÍÀÌ ÁÁ½À´Ï´Ù. ÀÌ·¸°Ô ÇØ¾ß ÀÚ½ÅÀÇ
ÀÛ¾÷ÀÌ ¼öÁ¤ ÀÏÁö(revision log)¿¡¼ ÀûÀýÇÏ°Ô ½Äº°µÉ ¼ö ÀÖ½À´Ï´Ù.
¾Æ·¡¿Í °°ÀÌ ¸í·ÉÀ» ³»¸®½Ã¸é µË´Ï´Ù. John Doe ´ë½Å¿¡ ÀÚ½ÅÀÇ À̸§°ú À̸ÞÀÏ ÁÖ¼Ò¸¦ »ç¿ëÇϼ¼¿ä.
$ bzr whoami "John Doe <john.doe@gmail.com>"±×·¯¸é Bazaar´Â ¼³Á¤ ÆÄÀÏÀ» »õ·Î ¸¸µé°Å³ª ¶Ç´Â ±âÁ¸ÀÇ ¼³Á¤ ÆÄÀÏÀ» ¼öÁ¤Çؼ »õ·Î¿î À̸§°ú À̸ÞÀÏ ÁÖ¼Ò¸¦ ±â·ÏÇÕ´Ï´Ù. ÀÌÁ¦ ÀÚ½ÅÀÇ À̸§°ú À̸ÞÀÏ ÁÖ¼Ò°¡ Á¦´ë·Î µî·ÏµÇ¾ú´ÂÁö È®ÀÎÇغ¸¼¼¿ä.
$ bzr whoami John Doe <john.doe@gmail.com> 4. ¹öÀü °ü¸® ¾Æ·¡ ÆÄÀÏ ³Ö±â ¶ÀÌÁ¦ µð·ºÅ丮¸¦ Çϳª ¸¸µé°í ÆÄÀÏ ¸î °³¿Í ÇÏÀ§ µð·ºÅ丮¸¦ ¸¸µé¾î¼
Bazaar¿Í ÇÔ²² »ç¿ëÇØ º¸µµ·Ï ÇսôÙ.
$ mkdir myproject $ cd myproject $ mkdir subdirectory $ touch test1.txt test2.txt test3.txt subdirectory/test4.txtÀ©µµ¿ìÁî »ç¿ëÀÚÀÇ °æ¿ì: À©µµ¿ìÁî ÀͽºÇ÷η¯¸¦ »ç¿ëÇؼ µð·ºÅ丮¸¦ ¸¸µå½Ã°í ±× µð·ºÅ丮·Î µé¾î°¡¼ ¿À¸¥ÂÊ ¹öÆ°À» Ŭ¸¯Çؼ »õ·Î¿î ÆÄÀÏÀ» ¸¸µå¼¼¿ä. ÀÌÁ¦ Bazaar°¡ ÇÁ·ÎÁ§Æ® µð·ºÅ丮¸¦ ÃʱâÈÇϵµ·Ï ¸í·ÉÀ» ³»¸®¼¼¿ä.
$ bzr init ¾Æ¹« Àϵµ ÀϾÁö ¾ÊÀº °Íó·³ º¸¿©µµ °ÆÁ¤ÇÏÁö ¸¶¼¼¿ä. Bazaar´Â °¡Áö(branch)¸¦ Çϳª
¸¸µé¾ú½À´Ï´Ù. °Å±â¿¡ ¿©·¯ºÐÀÇ ÆÄÀÏ°ú ¼öÁ¤ ¿ª»ç°¡ ±â·ÏµÉ °ÍÀÔ´Ï´Ù.
´ÙÀ½ ´Ü°è·Î Bazaar¿¡°Ô ¾î¶² ÆÄÀϵéÀ» ¹öÀü °ü¸®ÇÒ °ÍÀÎÁö ¾Ë·ÁÁÖ¼Å¾ß ÇÕ´Ï´Ù.
bzr add
¸í·ÉÀ» ³»¸®¸é ÇÁ·ÎÁ§Æ® ³»¿¡ ÀÖ´Â ¸ðµç °ÍµéÀÌ Â÷·Ê´ë·Î Ãß°¡µÉ °ÍÀÔ´Ï´Ù.
$ bzr add added subdirectory added test1.txt added test2.txt added test3.txt added subdirectory/test4.txt´ÙÀ½À¸·Î °¡Áö(branch)¿¡ ÆÄÀϵéÀ» ³Ñ°Ü¼(commit) ±â·ÏÇØ º¸¼¼¿ä. ¸Þ½ÃÁöµµ Ãß°¡Çϼ¼¿ä. $ bzr commit -m "Initial import"Bazaar´Â ºÐ»êÇü ¹öÀü °ü¸® ½Ã½ºÅÛÀ̱⠶§¹®¿¡ Áß¾Ó ¼¹ö¿¡ ¿¬°áµÉ ÇÊ¿ä°¡ ¾ø½À´Ï´Ù. Bazaar´Â ¿©·¯ºÐÀÇ °¡Áö(branch)¿Í ¸ðµç ³Ñ±æ ÆÄÀÏ(commit)À» ÇöÀç ÀÛ¾÷ÇÏ°í ÀÖ´Â µð·ºÅ丮 ³»ºÎ¿¡ º¸°üÇÕ´Ï´Ù. ÇÁ·ÎÁ§Æ® µð·ºÅ丮 ¾Æ·¡ .bzr À̶ó´Â ÇÏÀ§ µð·ºÅ丮¸¦ ã¾Æ º¸¼¼¿ä.
5. ÆÄÀÏ º¯°æÇϱ⠶ÆÄÀÏ Çϳª¸¦ °íÄ¡°í º¯°æ »çÇ×À» °¡Áö(branch)¿¡ ³Ñ°Ü(commit) º¾½Ã´Ù.
test1.txt ÆÄÀÏÀ» ÆíÁýÇÑ ÈÄ ´ÙÀ½Ã³·³ º¯°æ »çÇ×À» üũÇØ º¸¼¼¿ä.
$ bzr diff === modified file 'test1.txt' --- test1.txt 2007-10-08 17:56:14 +0000 +++ test1.txt 2007-10-08 17:46:22 +0000 @@ -0,0 +1,1 @@ +test test testBazaar °¡Áö(branch)¿¡ ÀÛ¾÷ ³»¿ëÀ» ³Ñ±â¼¼¿ä(commit). $ bzr commit -m "Added first line of text" Committed revision 2. 6. ¼öÁ¤ ÀÏÁö(revision log) º¸±â ¶ÀÏÁö(log)¸¦ º¸¸é ¿©·¯ºÐÀÇ °¡Áö(branch)ÀÇ ¿ª»ç¸¦ º¼ ¼ö ÀÖ½À´Ï´Ù.
$ bzr log ------------------------------------------------------------ revno: 2 committer: John Doe <john.doe@gmail.com> branch nick: myproject timestamp: Mon 2007-10-08 17:56:14 +0000 message: Added first line of text ------------------------------------------------------------ revno: 1 committer: John Doe <john.doe@gmail.com> branch nick: myproject timestamp: Mon 2006-10-08 17:46:22 +0000 message: Initial import 7. sftp·Î ÃâÆÇ(publish)Çϱ⠶¿©·¯ºÐÀÇ °¡Áö(branch)¸¦ ÃâÆÇ(publish)ÇÏ´Â ¹æ¹ýÀº ¿©·¯°¡Áö°¡ ÀÖ½À´Ï´Ù.
¸¸¾à SFTP ¼¹ö¸¦ Çϳª °¡Áö°í Àְųª ¾Æ´Ï¸é ½±°Ô Çϳª ¸¸µé ¼ö ÀÖ´Ù¸é
±×°ÍÀ» ÀÌ¿ëÇؼ ÃâÆÇ(publish)ÇÒ ¼ö ÀÖ½À´Ï´Ù.
¾Æ´Ï¸é, ´ÙÀ½ ¼½¼ÇÀ¸·Î ³Ñ¾î°¡¼ Launchpad¿¡¼
ÃâÆÇ(publish)ÇØ º¸¼¼¿ä. Launchpad´Â Bazaar¸¦ À§ÇÑ ¹«·á È£½ºÆà ¼ºñ½ºÀÔ´Ï´Ù.
ÀÏ´Ü ¿©·¯ºÐÀÇ °¡Áö(branch)¸¦
www.example.com/myproject ¿¡ ÃâÆÇ(publish)ÇÑ´Ù°í
°¡Á¤ÇØ º¾½Ã´Ù.
$ bzr push --create-prefix sftp://your.name@example.com/~/public_html/myproject 2 revision(s) pushed.Bazaar´Â ¿ø°Ý ¼¹ö¿¡ myproject ¶ó´Â µð·ºÅ丮¸¦ ¸¸µé°í ±× ¾È¿¡ °¡Áö(branch)¸¦ Áý¾î³ÖÀ» °Ì´Ï´Ù.
ÁÖÀÇ: sftp¸¦ »ç¿ëÇϱâ À§Çؼ
paramiko ¿Í pyCrypto ¸¦ ¼³Ä¡ÇØ¾ß ÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
ÀÚ¼¼ÇÑ ³»¿ëÀº http://bazaar-vcs.org/InstallationFaq¸¦ ÂüÁ¶Çϼ¼¿ä.
ÀÌÁ¦ ´©±¸µçÁö ¿©·¯ºÐÀÇ °¡Áö(branch)¸¦ ¹Þ¾Æ¼ ÀڽŸ¸ÀÇ º¹Á¦º»À» ¸¸µé ¼ö ÀÖ½À´Ï´Ù. ´ÙÀ½ ¸í·ÉÀ¸·Î¿ä:
$ bzr branch http://www.example.com/myproject 8. Launchpad¿¡¼ ÃâÆÇ(publish)Çϱ⠶Launchpad´Â ÀÚÀ¯ ¼ÒÇÁÆ®¿þ¾î ÇÁ·ÎÁ§Æ®¸¦ À§ÇÑ °³¹ß ¹× È£½ºÆà µµ±¸ ¸ðÀ½ÀÔ´Ï´Ù. ¿©·¯ºÐµµ ÀÌ¿ëÇϽÇ
¼ö ÀÖ½À´Ï´Ù.
¾ÆÁ÷ Launchpad °èÁ¤ÀÌ ¾øÀ¸½Ã¸é, Çϳª ¸¸µå¼¼¿ä.
¾Æ·¡Ã³·³, john.doe ´ë½Å¿¡ ÀÚ½ÅÀÇ Launchpad »ç¿ëÀÚ¸íÀ» ½á¼, ¸í·ÉÀ» ³»¸®¼¼¿ä.
$ bzr push bzr+ssh://john.doe@bazaar.launchpad.net/~john.doe/+junk/myprojectÂü°í: +junk ´Â ÀÌ °¡Áö(branch)°¡ ±âÁ¸ÀÇ Æ¯Á¤ ÇÁ·ÎÁ§Æ®¿Í ¿¬°üÀÌ ¾ø´Ù´Â ¶æÀÔ´Ï´Ù.
ÀÌÁ¦, ´©±¸µçÁö ¿©·¯ºÐÀÇ °¡Áö(branch)¸¦ ¹Þ¾Æ¼ ÀڽŸ¸ÀÇ º¹Á¦º»À» ¸¸µé ¼ö ÀÖ½À´Ï´Ù.
$ bzr branch http://bazaar.launchpad.net/~john.doe/+junk/myproject ±×¸®°í, ¿©·¯ºÐÀÇ °¡Áö(branch)¿¡ °üÇÑ Á¤º¸´Â ¾Æ·¡¿Í °°Àº ÁÖ¼Ò¿¡¼ º¸½Ç ¼ö ÀÖ½À´Ï´Ù.
https://code.launchpad.net/people/+me/+junk/myproject 9. ´Ù¸¥ °¡Áö(branch)ÀÇ º¹Á¦º» ¸¸µé±â ¶´Ù¸§ »ç¶÷ÀÇ Äڵ带 °¡Áö°í ÀÛ¾÷Çϱâ À§ÇÑ ¸ñÀûÀ¸·Î ±×µéÀÇ °¡Áö(branch)ÀÇ º¹Á¦º»À» ¸¸µé ¼ö
ÀÖ½À´Ï´Ù. ½ÇÁ¦ ¿¹¸¦ Çѹø º¸Áö¿ä. BazaarÀÇ GTK ÀÎÅÍÆäÀ̽º¸¦ ¿¹·Î µé¾îº¾½Ã´Ù.
$ bzr branch http://bazaar.launchpad.net/~bzr/bzr-gtk/trunk bzr-gtk.john Branched 292 revision(s).Bazaar´Â bzr-gtk ÇÁ·ÎÁ§Æ®ÀÇ Áٱ⠰¡Áö(trunk branch)¿¡¼ ÆÄÀϵé ÀüºÎ¿Í ¼öÁ¤ ¿ª»ç¸¦
¿ÏÀüÈ÷ ´Ù¿î·Îµå ¹Þ¾Æ¼ º¹Á¦º»À» ¸¸µé°í bzr-gtk.john À̶ó°í À̸§ºÙÀÏ °Ì´Ï´Ù.
ÀÌÁ¦, ¿©·¯ºÐÀÇ ÀڽŸ¸ÀÇ º¹Á¦º¹À» °¡Áö°Ô µÇ¾ú½À´Ï´Ù. ³×Æ®¿öÅ© ¿¬°áÀÌ Àְųª ¾ø°Å³ª °ü°è¾øÀÌ
º¯°æ »çÇ×À» ³Ñ±æ(commit) ¼ö ÀÖ½À´Ï´Ù. ±×¸®°í ¿©·¯ºÐÀÇ °¡Áö(branch)¸¦ ¾ðÁ¦µçÁö
ÃâÆÇ(publishing)À» ÅëÇؼ ´Ù¸¥ »ç¶÷µé°ú °øÀ¯ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¸¸¾à¿¡
bzr-gtk ÆÀÀÌ
¿©·¯ºÐÀÇ ÀÛ¾÷À» »ç¿ëÇÏ°í ½Í¾îÇÑ´Ù¸é, Bazaar´Â ±×µéÀÌ ¿©·¯ºÐÀÇ °¡Áö(branch)¸¦ ±×µéÀÇ
Áٱ⠰¡Áö(trunk branch)¿¡ º´ÇÕ(merge)ÇÏ´Â °ÍÀ» ½±°Ô ÇØÁÙ °ÍÀÔ´Ï´Ù.
10. ÁÖ °¡Áö(main branch)¿¡¼ ÀÚ½ÅÀÇ °¡Áö(branch) °»½ÅÇϱ⠶¿©·¯ºÐÀÌ ÀÚ½ÅÀÇ °¡Áö(branch)¿¡ º¯°æ »çÇ×À» ³Ñ±â´Â(commit) µ¿¾È, ´Ù¸¥ »ç¶÷µéÀÌ
ºÎ¸ð °¡Áö(parent branch)¿¡ Äڵ带 ³Ñ±â´Â(commit) ÀÛ¾÷ÀÌ ÁøÇàµÉ ¼ö ÀÖ½À´Ï´Ù.
¿©·¯ºÐÀÇ °¡Áö(branch)°¡ ÃֽŠ»óÅÂÀÎ °ÍÀ» È®ÀÎÇϱâ À§Çؼ ºÎ¸ð¿¡°Ô¼ º¯°æ»çÇ×À» ¹Þ¾Æ
ÀÚ½ÅÀÇ °³ÀÎ °¡Áö(branch)¿¡ º´ÇÕ(merge)ÇØ¾ß ÇÕ´Ï´Ù.
$ bzr merge Using saved location: http://bazaar.launchpad.net/~bzr/bzr-gtk/trunk All changes applied successfully. º¯°æ »çÇ×ÀÌ ¹«¾ùÀÌ ÀÖ´ÂÁö È®ÀÎÇØ º¸¼¼¿ä.
$ bzr diff º¯°æ »çÇ׿¡ ºÒ¸¸ÀÌ ¾ø´Ù¸é, ±× ³»¿ëÀ» ¿©·¯ºÐÀÇ °³ÀÎ °¡Áö(branch)¿¡ ³Ñ±æ(commit) ¼ö ÀÖ½À´Ï´Ù.
$ bzr commit -m "Merge from main branch" Committed revision 295. 11. ÀÚ½ÅÀÇ ÀÛ¾÷À» ºÎ¸ð °¡Áö(parent branch)¿¡ º´ÇÕ(merge)Çϱ⠶¿©·¯¤²¤¤ÀÌ
bzr-gtk ÀÇ °³ÀÎ °¡Áö(branch)¿¡¼ ÀÛ¾÷À» ÇÑ ÈÄ¿¡ ÀÚ½ÅÀÌ º¯°æÇÑ ³»¿ëÀ»
ÇÁ·ÎÁ§Æ®¿¡ ¿Ã·Áº¸³»°í ½ÍÀ» ¼ö ÀÖ½À´Ï´Ù. °¡Àå °£´ÜÇÑ ¹æ¹ýÀº º´ÇÕ(merge) ¸í·ÉÀ» ÀÌ¿ëÇÑ
°ÍÀÔ´Ï´Ù.
º´ÇÕ(merge) ¸í·ÉÀº ±â°è°¡µ¶Çü ¿äûÀ¸·Î ƯÁ¤ÇÑ º´ÇÕ(merge)À» ¼öÇàÇÕ´Ï´Ù. º¸ÅëÀº
º´ÇÕ(merge)ÀÇ ÆÐÄ¡ ÇÁ¸®ºä (patch preview)¸¦ Æ÷ÇÔÇÏ°í ÀÖ½À´Ï´Ù. ±×¸®°í ÇÊ¿äÇÑ
¼öÁ¤ÆÇ(revision)µéÀÌ Æ÷ÇԵǰųª ¶Ç´Â ÇØ´ç ¼öÁ¤ÆǵéÀ» ´ã°í ÀÖ´Â °¡Áö(branch)°¡
Á¦°øµÉ ¼ö ÀÖ½À´Ï´Ù.
mycode.patch ¿¡ ¿©·¯ºÐÀÇ º´ÇÕ ¸í·É(merege directive)¸¦ ¸¸µé·Á¸é:
$ bzr send -o mycode.patch Using saved location: http://bazaar.launchpad.net/~bzr/bzr-gtk/trunk ÀÌÁ¦ º´ÇÕ ¸í·ÉÀ» À̸ÞÀÏ·Î
bzr-gtk ÇÁ·ÎÁ§Æ®¿¡ º¸³»¼¼¿ä. ±×µéÀÇ ¼±Åÿ¡ µû¶ó
¿©·¯ºÐÀÇ ÀÛ¾÷ÀÌ ºÎ¸ð °¡Áö¿¡ º´ÇÕµÉ ¼ö ÀÖ½À´Ï´Ù.
12. ´õ ¹è¿ì±â ¶Bazaar¿¡ °üÇؼ ´õ ¹è¿ì°í ½ÍÀ¸½Ã¸é
Bazaar user guide¸¦ µÑ·¯º¸¼¼¿ä.
¸í·ÉÇà¿¡¼ Bazaar¿¡ °üÇØ ¹è¿ì°í ½ÍÀ¸½Ã¸é:
$bzr help Bazaar ¸í·Éµé¿¡ ´ëÇØ ¾Ë°í ½ÍÀ¸½Ã¸é:
$ bzr help commands ƯÁ¤ÇÑ "foo" ¶ó´Â ÁÖÁ¦³ª ¸í·É¿¡ ´ëÇØ ¾Ë°í ½ÍÀ¸½Ã¸é:
$ bzr help foo |
Like winter snow on summer lawn, time past is time gone. |