ããŒãé貚ã«ç²Ÿéããããã¹ãŠã®äººãšãæ¥éã«å€åããããŒã¿ã«äœããã®æ¹æ³ã§å¯ŸåŠããŠãããã¹ãŠã®äººãæåŸ ããŸãã
ãªããããå¿ èŠã§ãã
ç§èªèº«ã¯å·¥ç§å€§åŠã®åŠçã§ãããã»ãŒåžžã«ããã¥ã¡ã³ãïŒããã¹ããå³é¢ãå³é¢ïŒãæäœãã1æ¥ã«3åïŒ10ã100ïŒå€æŽããŠããŸãã å é±è¡ãããç·šéããã£ã³ã»ã«ããŠã1é±éåã®ç¶æ ã®ããã¥ã¡ã³ãã«æ»ãå¿ èŠãããããšãå€æããå ŽåããããŸãã ããŠãå°ãã®ç·šéãè¡ãããå Žåããã®å ŽåãCtrl + Zã§50åã®ãããã圹ç«ã¡ãŸãã ãã ããä»é±äžã«ããã¥ã¡ã³ãã®äœæ¥ãå€ããå°ãªããè¡ãããå Žåãã1é±éåã«è¡ãããéèŠãªãªããžã§ã³ã«ãã¹ããŒã¿ã¹ã埩å ã§ããŸããã ãããè¡ãã«ã¯ããéèŠãªãªããžã§ã³ã®åãã®æç¹ã§ã®ããã¥ã¡ã³ãã®ã³ããŒãšããå¥ã®éèŠãªãªããžã§ã³ãžãããçããããªããžã§ã³ãžããããã£ã³ã»ã«ããå¿ èŠããããããªããªããžã§ã³ãžã®ã³ããŒãããã«12åå¿ èŠã§ãã ååãšããŠããã®ã¢ãããŒãã¯å¯èœã§ãããå€ãã®äººã«ãã£ãŠå®è·µãããŠããŸãã æè¿ãŸã§ãç§èªèº«ãéèŠãªããŒãžã§ã³ã®ãã¡ã€ã«ãä¿æãããdate_timeããšãããã¬ãã£ãã¯ã¹ãä»ããŠä¿åããŠããŸããããåãã§ããããã§ãã ãã®æ¹æ³ã®å©ç¹ã¯åçŽãã§ãããæ¬ ç¹ã¯äœæ¥ãã©ã«ããŒã®ãèšåŒµããšäœ¿çšã®äžäŸ¿ãã§ãã ãããŠããããããã®ãã¡ã®æåã®ãã®ãäœããã®åœ¢ã§æŠãããšãã§ãããªãïŒå€§ããªããŒããã©ã€ããš7zipã䜿ã£ãŠïŒãäžäŸ¿ã§äœããããªããã°ãªããŸããã§ããã
ããã§ã§ããããšããŸãã¯SLEãšã¯
ãŠã£ãããã£ã¢ãã段èœãåãåããŸãããããŒãžã§ã³ç®¡çã·ã¹ãã ïŒè±èªçã®ããŒãžã§ã³ç®¡çã·ã¹ãã ãVCSããŸãã¯ãªããžã§ã³ç®¡çã·ã¹ãã ããïŒã¯ãå€åããæ å ±ã®åŠçã容æã«ãããœãããŠã§ã¢ã§ãã ããŒãžã§ã³ç®¡çã·ã¹ãã ã䜿çšãããšãåãããã¥ã¡ã³ãã®è€æ°ã®ããŒãžã§ã³ãä¿åããå¿ èŠã«å¿ããŠä»¥åã®ããŒãžã§ã³ã«æ»ã£ãŠã誰ããã€å€æŽãå ããããå€æã§ããŸãã ãŠã£ãããã£ã¢èªäœã®ååã®ããã«èŠããŸã-ãã¹ãŠã®ç·šéãå«ãèšäºã®ãã¹ãŠã®ããŒãžã§ã³ãåŠç¿ã«å©çšã§ããŸãã
ãããã£ãŠãå€ãã®ããŒãžã§ã³ã®ãã¡ã€ã«ãä¿åããå¿ èŠãããç¶æ³ã§ããŒãé貚ã䜿çšããããšãå¿ èŠã§ãã ãã®ã¢ãããŒãã®å©ç¹ã«ã¯ã䜿ãããããšããããããã«ã¿å§çž®ã«ãã空ããã£ã¹ã¯å®¹éã®ç¯çŽãå«ãŸããŸãïŒãã¡ã€ã«ã¯ç°ãªãããŒãžã§ã³ã§ä¿åããããããŒãžã§ã³ããšã«å€æŽããããããä¿åãããããŒã¿éãåæžãããŸãïŒã ãã£ãŠã¿ãŸãããã
SLEãšã¯
åããŠã£ãããã£ã¢ã§ã¯ãSLEã¯ããŒã·ã§ã³ã®æç¡ã«ãããããã倧å°ãåããäžå åããã³åæ£ãããŠããããšã瀺åãããŠããŸãã ããŒãã«ã¬ã³ã·ãŒæ©èœã®äžéšã®ã¿ãïŒå°ãªããšãæåã¯ïŒäœ¿çšãããããããã«ç¹ã«é¢å¿ã¯ãããŸããã ããããŸãã«æ©èœã ãšèããŸãã
ã»ãšãã©ãã¹ãŠã®ç¡¬è²šã¯ãäœããã®çš®é¡ã®ã¹ãã¬ãŒãžãè¡šããäœæ¥ãããã¡ã€ã«ã®ãã¹ãŠã®ããŒãžã§ã³ãä¿åããŸãã ããã§ã¯ãä¿åãããŠãããã¡ã€ã«ã®ããŒãžã§ã³ããŠãŒã¶ãŒã«ãã£ãŠæãé »ç¹ã«æ±ºå®ãããããšãæ確ã«ããå¿ èŠããããŸãã ããšãã°ãçŽ12ã®å°ããªå€æŽãè¡ããã¢ã¯ãã£ããã£ã®çµæããªããžããªã«ä¿åãããšãã ãšå€æããŸããã é¡æšã¯å®æçã«Ctrl + SãæŒãããšã§é ã«æµ®ãã³ãŸãããå¯äžã®éãã¯ããã®ããŒãžã§ã³ã®ãã¡ã€ã«ã«å°æ¥ã¢ã¯ã»ã¹ã§ããããšã§ãã åœç¶ã®ããšãªããããã®æ¹æ³ã§äžæ°ã«å€§éã®ãã¡ã€ã«ã®ããŒãžã§ã³ãã¹ãã¬ãŒãžã«ä¿åã§ããŸãã ãã®ã¢ã¯ã·ã§ã³ã¯ãåçŽãªæ¹æ³ã§ãã³ãããããŸãã¯ãå€æŽã®ã³ãããããšåŒã°ããŸãã
ãã€ã§ãããªããžããªã«æ°ãããã¡ã€ã«ãè¿œå ãããããªããžããªå ã®æ¢åã®ãã¡ã€ã«ãåé€ãããã§ããŸãïŒããã¯ã¹ãã¬ãŒãžã®ã¹ããŒãåã§ãïŒãããŒãé貚ã¯ããã€/äœãè¿œå /åé€ãããããèšæ¶ãããŸãã ãŸããcommit'ahsã®ã³ã¡ã³ãã®ãããã§ããã®ç¹å®ã®ã³ããããå®éã«å®è¡ãããçç±ã説æããããšãã§ããŸãïŒãããã«å®ç©ã®å®ç³ãè¿œå ããŸããã/ãããããå¿ èŠãªéšåãåé€ãããïŒã
1é±éåã®ããŒãžã§ã³ã«æ»ãæãæ¥ãããšãããããç解ãããšãå€æŽã®å šå±¥æŽããããŸãã ãããŠãããã§äœãããããéžæã§ããŸãã å€ããã¡ã€ã«ããå¿ èŠãªéšåãã³ããŒããŠçŸåšã®ããŒãžã§ã³ã«è²Œãä»ããå¿ èŠãããå Žåã¯ãã¹ãã¬ãŒãžããå€ããã¡ã€ã«ãæœåºããå¿ èŠãªãã¡ã€ã«ãããããã³ããŒããŸãã å®å šã«ããŒã«ããã¯ããŠå€ãããŒãžã§ã³ã§ã®äœæ¥ãç¶ããå¿ èŠãããå ŽåãSLEãåã³æ¯æŽããŸãã以åã®ããŒãžã§ã³ã«æ»ã£ãŠãããããæ°ãããã©ã³ãïŒããã©ã³ããïŒãäœæã§ããŸãã 1é±éåã®ããŒãžã§ã³ã ãããã£ãŠããããžã§ã¯ãã®ããŒãžã§ã³å±¥æŽã¯ããã«ãŒããïŒãããžã§ã¯ãã®éå§ïŒããããã©ã³ããïŒç·šéã®æåããã³å€±æïŒãŸã§ãããªãŒåœ¢åŒã§ã°ã©ãã£ã«ã«ã«è¡šãããšãã§ããŸãã ããã«ãããšãã°ã1ã€ã®ãœãŒã¹ãã¡ã€ã«ãã2ã€ã®ç°ãªãããŒãžã§ã³ãéçºããããšã決å®ããå Žåãªã©ãããã©ã³ããã人çºçã«äœæããããšãã§ããŸãã ããã«ãäœæ¥ãã¡ã€ã«ãããã¹ãããã¥ã¡ã³ãïŒããã³ãã®ä»ã®ããã¥ã¡ã³ãïŒã§ããå Žåãç°ãªããã©ã³ãã1ã€ã«çµåããããšãã§ããŸã-ããããããŒãžïŒãããŒãžãïŒã ããã§ãæ°äººã®äººã ããããžã§ã¯ãã«åãçµãã§ããããããããç¬èªã®ãå®ç©ã®å®ç³ãã«åŸäºããŠãããšæ³åããŠãã ããã ãã®å Žåãå ±éã®ãªããžããªã䜿çšãããšãéçºãå€§å¹ ã«ç°¡çŽ åãããŸãã
çè«ããå®è·µãŸã§ããŸãã¯SLEã®äœ¿çšãéå§
ã§ããããSLEã䜿çšããããšã¯è¯ãããšã ãšç¢ºä¿¡ããŠããã ããã°å¹žãã§ãã ããŒãé貚ã®äœ¿çšæ¹æ³ãåŠã¶ããšã ããæ®ã£ãŠããŸãã ãããç§ãã¡ãããããšã§ãã
䜿çšã®ããŸããŸãªé¢ã§äºãã«ç°ãªãããŸããŸãªããŒãžã§ã³ç®¡çã·ã¹ãã ããããŸãã ç§ãã¡ã¯ïŒå°ãªããšãæåã¯ïŒããŸããŸãªã·ã¹ãã ã®è€éãã«èå³ããªãã®ã§ãæãåçŽã§æãå奜çãªã·ã¹ãã ã«ã€ããŠèª¬æããŸãã ç§ã®è¬èãªæèŠã§ã¯ãå¥åŠãªããšã«ããã®ãããªã·ã¹ãã ã¯Mercurialã§ããTortoiseHgã°ã©ãã£ã«ã«ã·ã§ã«ãåãããéåžžã«å€§ããªã³ãŒããªããžããªã§å¹æçã«åäœããããã«èšèšãããã¯ãã¹ãã©ãããã©ãŒã åæ£ããŒãžã§ã³ç®¡çã·ã¹ãã ãã§ãã ã·ã¹ãã ã®æäœã¯ãWindowsãLinuxãããã³Mac OS Xã§å¯èœã§ãã
Windowsã®ã·ã¹ãã ã§ã®äœæ¥ã説æããäºçŽãããã«è¡ããŸãã Linuxãç¿åŸããã®ã§ããã¹ãŠãé¡æšããããšã¯é£ãããããŸããã
ããã«ãMercurialãªããžããªïŒbitbucket.orgïŒã®ç¡æãã¹ãã£ã³ã°ã®äœ¿çšæ¹æ³ã«ã€ããŠãåŠç¿ããŸããããã¯ããããžã§ã¯ãã ãã§äœæ¥ããŠããªãå Žåã«å¿ èŠãªãã®ã§ãããéåžžã«äŸ¿å©ãªå Žåã¯ã€ã³ã¿ãŒãããçµç±ã§ãããžã§ã¯ãã®ãã¹ãŠã®ããŒãžã§ã³ã«ã¢ã¯ã»ã¹ãããå Žåã«äœ¿çšããŸã å®éãããã䜿çšããããšãããå Žåãããã¯äŸ¿å©ãªDropboxã®ä»£æ¿åã§ãã
éå§ããã«ã¯ã次ã®å ŽæããMercurial + TortoiseHgãã€ã³ã¹ããŒã«ããŸãïŒtortoisehg.bitbucket.orgã
ãã®ã·ã¹ãã ã¯ã³ã³ãœãŒã«ã§æ©èœããããã䟿å®äžãåŸã§éåžžã®æäœçšã«ããã€ãã®* .batãã¡ã€ã«ãäœæããŸãã
ãã¹ãŠã®æäœã¯ãhgã³ãã³ãã«ãã£ãŠå®è¡ãããŸãã ãã©ã¡ãŒã¿ãªãã§åŒã³åºããããšãåºæ¬çãªã³ãã³ãã®ãªã¹ãã衚瀺ãããŸãã
éžæãããã£ã¬ã¯ããªã¯ãªããžããªãšããŠæ©èœãïŒãCïŒ\ project \ããã©ã«ãã䜿çšããŸãïŒãããã«å°æ¥ã®ãããžã§ã¯ãã®ãã¹ãŠã®ãã¡ã€ã«ãä¿åããå¿ èŠããããŸãã ãã¡ãããåãã³ã³ãã¥ãŒã¿ãŒäžã«è€æ°ã®ãªããžããªãŒãæã€ããšãçŠæ¢ãã人ã¯ããŸããã
ã·ã¹ãã ããªããžããªãäœæããããšããç解ãããããã«ã次ã®ã³ãã³ããå®è¡ããŸãã
hg init c:\project
ãã®åŸããã©ã«ããŒãcïŒ\ project \ããäœæãããŸãïŒä»¥åã«äœæãããŠããªãå ŽåïŒããã©ã«ããŒãcïŒ\ project \ .hg \ããMercurialã¯ãã¹ãŠã®ãµãŒãã¹æ å ±ãä¿åããŸãã
ã³ã³ãã¥ãŒã¿ãŒã®ããŒã«ã«ãªããžããªã ãã§ãªãããã¹ãŠã®å€æŽãéä¿¡ãããªã¢ãŒããªããžããªãååŸããããšãããã«æãåºããŸãïŒãŸãã¯ãè³¢ã人ãèšãããã«ãè±èªã®ãããã·ã¥ããããªã¢ãŒããªããžããªã«ãããã·ã¥ãå€æŽïŒã ãããè¡ãã«ã¯ãbitbucket.orgã«ã¢ã¯ã»ã¹ããŠç»é²ããæåã®ãªããžããªãäœæããŸãïŒãªããžããª-æ°ãããªããžããªã®äœæïŒã ãªããžããªã«ååãä»ãïŒæ確ã«ããããã«remote_projectãšåŒã³ãŸãïŒã[ãªããžããªã®äœæ]ãã¯ãªãã¯ããŸãã
çŸåšã2ã€ã®ãªããžããªããããŸãããcïŒ\ project \ããã©ã«ããŒã«ããããŒã«ã«ãªããžããªãšãbitbucket.org/your_account_name/remote_project/ãã«ãããªã¢ãŒããªããžããªã§ããyour_account_nameã¯bitbucketã§ç»é²ãããšãã«æå®ãããªããžããªãremote_projectã¯ãªããžããªã®ååãäœææã«éžæãããŸããã
調æ»ãç¶è¡ããã«ã¯ãããŒã«ã«ãªããžããªã«äœãã眮ãå¿ èŠããããŸãã ãã®äžã«å°æ¥ã®ãããžã§ã¯ãã®ãã¡ã€ã«ãäœæãããïŒç§ã®å ŽåããcïŒ\ project \ããã©ã«ãã«ïŒãçŸåšã®ãããžã§ã¯ããããã«ã³ããŒããŸãã
å³å¯ã«èšãã°ãMercurialã«æ¬¡ã®ããã«äŒããå¿ èŠããããŸããããã®ãããªãã¡ã€ã«ãšããã€ãã®æ°ãããã©ã«ããŒããããžã§ã¯ããã©ã«ããŒã«è¿œå ããŸããããããã«ã¯ãhg addãã³ãã³ããæäŸãããŸãã ãã ããå¥ã®ã¢ãããŒãããã䟿å©ã§ã-次ã®ã³ãããã§ãMercurialã«ãããžã§ã¯ããã©ã«ããŒããæ°ããäœæããããã¹ãŠã®ãã¡ã€ã«ãååŸããåé€ããããã¡ã€ã«ãå¿ããããã«æ瀺ããŸãããæ°ããããã¥ã¡ã³ããäœæãããã³ã«hg add cïŒ\ project \ new_document.docããå®è¡ãããããã¯ããã«ç°¡åã§ãã
ããã§ã¯ãæåã®ã³ãããã«åãæãããŸãããã 次ã®ã³ãã³ãã§å®è¡ãããŸãã
hg commit âA âm âcomment to commitâ
é çªã«èŠãŠã¿ãŸãããã ãã®ã³ãã³ãã¯ããªããžããªã«ãããšãã«å ¥åããå¿ èŠããããŸãïŒã€ãŸããæåã«ãcd cïŒ\ projectããå®è¡ããå¿ èŠããããŸãïŒã ã-Aããªãã·ã§ã³ã¯ãMercurialãæ°ãã«äœæããããã¡ã€ã«ããããã¯ã¢ãããããããã«å¿ èŠã§ãïŒäžèšåç §ïŒãã-mããªãã·ã§ã³ã䜿çšãããšãã³ãããã«ã³ã¡ã³ããè¿œå ã§ããŸãã ãããã®ã³ã¡ã³ãã¯ãTortoiseHgãšbitbucket.orgã®ãããžã§ã¯ãããŒãžã§ããŒãžã§ã³ïŒãŸãã¯å€æŽã»ãã-å€æŽãªã¹ãïŒã衚瀺ãããšãã«è¡šç€ºãããŸãã åŸã§èŠãããããªãããã«æå³ã®ããã³ã¡ã³ããäžããããšã¯éåžžã«éèŠã§ããããããŸãã¯ãã®æ¹èšããã€è¡ãããããèŠããŠããŸãã
ããã§ãªããžããªã«ãããžã§ã¯ãã®åæããŒãžã§ã³ãä¿åãããŸããã ãã以éã®ãã¹ãŠã®ã³ãããã¡ã³ãã¯ãçŸåšã®ããŒãžã§ã³ãä¿åãããšãã ãšå€æããåŸãåæ§ã«å®è¡ãããŸãã
次ã®ã³ãã³ãã䜿çšããŠãã³ãããããªã¢ãŒããªããžããªã«ãããã·ã¥ãã§ããŸãã
hg push https://bitbucket.org/__/remote_project
åæã«ããªããžããªã«å¯Ÿå¿ãããã©ã«ãã«ãããå¿ èŠããããŸãã ã³ãã³ããå ¥åãããšãbitbucket.orgã®ã¢ã«ãŠã³ãã®ååãšãã¹ã¯ãŒããèŠæ±ããããããããã·ã¥ãããã³ã«å ¥åããªãããã«ãã³ãã³ãã次ã®ããã«çœ®ãæããããšãã§ããŸãã
hg push hg push https://__:__@bitbucket.org/__/remote_project
ãã¹ãŠã®ã³ãã³ãã* .batãã¡ã€ã«ã«å€æããããããã®å Žåããã¹ã¯ãŒãã¯å¹³æã§ä¿åãããã»ãã¥ãªãã£äžã®ãªã¹ã¯ãçããŸãããç§ã«ãšã£ãŠã¯ããã§åé¡ãããŸããã
ãã®ããã䟿å®äžã次ã®å 容ã®commit.batãpush.batããã³commitïŒpush.batãã¡ã€ã«ãçŽæ¥å°éãŸãŒã³ã«äœæããŸãã
[commit.batãã¡ã€ã«ã®å 容]
IF !%1==! goto exit1
cd C:\project
hg commit -A -m "%*"
goto exit0
:exit1
echo "NO COMMAND-LINE ARG!"
:exit0
åŒæ°ä»ãã§åŒã³åºããããã®ãã¡ã€ã«ã¯ãã³ãããã³ã¡ã³ãå ã®åŒæ°ã䜿çšããŠãããžã§ã¯ãã³ããããå®è¡ããŸãã äŸïŒãcommit.bat my first commitããå®è¡ããã³ã¡ã³ããmy first commitãã§ã³ããããååŸããŸãã FARã§ã¯ãCtrl + Enterã®çµã¿åããã䜿çšãããšäŸ¿å©ã§ãã
[push.batãã¡ã€ã«ã®å 容]
cd C:\project
hg push https://__:__@bitbucket.org/__/remote_project
ãã®ãã¡ã€ã«ã¯ãªã¢ãŒããªããžããªã«ããã·ã¥ãããŸãã
[commitïŒpush.batãã¡ã€ã«ã®å 容]
IF !%1==! goto exit1
cd C:\project
hg commit -A -m "%*"
goto exit0
:exit1
echo "NO COMMAND-LINE ARG!"
:exit0
call ./push.bat
åŒæ°ä»ãã§åŒã³åºããããã®ãã¡ã€ã«ã¯ãé 次ã³ããããå®è¡ããã³ãããããã³ã¡ã³ãã«å ¥åãããåŒæ°ã䜿çšããŠãããžã§ã¯ããããã·ã¥ããŸãã
ããã«ãå°ããªäžéã³ãããã®å Žåãcommit_date_time.batãã¡ã€ã«ãäœæããããšããå§ãããŸãã
[commit_date_time.batã®å 容]
cd C:\project
hg commit -A -m "%DATE% %TIME%"
ãã®ãã¡ã€ã«ã¯ãçŸåšã®æ¥ä»ãšæå»ãã³ã¡ã³ããšããŠã³ãããããŸããããã¯ãã°ãã°äŸ¿å©ã§ãã
誰ããç·šéã®åŒ·åºŠãšè€éãã«å¿ããŠcommit'ovãšpush'eyã®é »åºŠãåå¥ã«æ±ºå®ããŸãã ãããé »ç¹ã«-ããè¯ãããšããã«ãŒã«ã«åŸãããšããå§ãããŸããã
ãªããžããªã®ãã¡ã€ã«/ãã©ã«ããŒãå³ã¯ãªãã¯ãããšããªããžããªãšã¯ã¹ãããŒã©ãŒïŒTortoiseHg-ãªããžããªãšã¯ã¹ãããŒã©ãŒïŒãèµ·åã§ããŸããããã«ãããã³ãããã®ãã¹ãŠã«ã³ã¡ã³ãã衚瀺ãããŸãã ãã®ãŠã£ã³ããŠã«ã¯ããªããžããªã®ããªãŒæ§é ã衚瀺ãããŸããããããã以åã®ããŒãžã§ã³ãžã®ã³ããããããã·ã¥ãããŒã«ããã¯ïŒããã¯ã¢ãŠãïŒããã³ãã®ä»ã®æäœãè¡ãããšãã§ããŸãã
bitbucket.org/your_account_name/remote_projectã§åæ§ã®å€æŽã»ãããèŠã€ããããšãã§ãã1ã€ã®ã¢ãŒã«ã€ãã«ãããžã§ã¯ãã®ä»»æã®ããŒãžã§ã³ãããŠã³ããŒãã§ããŸããããã¯éåžžã«äŸ¿å©ãªå ŽåããããŸãã
äžè¬ã«ãMercurialãšã®æåã®ç¥ãåãã¯çµãã£ããšæããŸãã 詳现ã«ã€ããŠã¯ã translate.by / you / mercurial- the-definitive-guide / into-ru / trans /ã«ãåãåãããã ããã
ãã®èšäºã®å¯Ÿè±¡è
ãããããã©ãããå§ããã°ããã®ã§ããããããã®èšäºã¯èª°ã®ããã®ãã®ã§ããïŒ çãã¯ç°¡åã§ã-ããŒãé貚ã®äœ¿çšæ¹æ³ãåŠã³ãã人ã®ããã«ã ç§ã¯äœäººãã®ãã¶ã€ããŒããšã³ãžãã¢ãããã«ã¯äœå®¶ã§ãããé貚ã«ãããã¯ãããŸããã ãããšããªããè©ŠããŠãã ãã-ããã¯ããªãã®ä»äºã倧ãã«ä¿é²ã§ããŸãã
PSããŒãžã§ã³ç®¡çã·ã¹ãã ã®ããã°ã«ç§»åããŸããã