mercuiralã使ããªããgithubã®pull requestãåãè¾¼ãæ¹æ³
http://partake.in/events/95ab571f-c477-43dd-8d96-396d3b670b6f:title=ã®ææçºè¡¨ã§ãã
å
æ¥ããmercurialãªãã¸ããªã®ãã©ã¼ãªãã¸ããªãgithubã«ä½æããã¨ãããéçºãgithubã«ç§»ã£ã¦ãã¾ãã¨ãã(mercurial使ãçã«ã¯)ã·ã§ããã³ã°ãªåºæ¥äºãããã¾ãããmercurial使ãã¯ããããè©èº«ãçãã§ããã
ããããããããmercuiralã使ããªããgithubã®pull requestãåãè¾¼ãæ¹æ³ãã«ã¤ãã¦ã®ãã¦ãã¦ãå ±æããã¦ããªããã¨ã«åé¡ãããã¾ããä»å¾ãäºåº¦ã¨æ²åãç¹°ãè¿ããªãããã«èå¯ãã¦ã¿ã¾ããã
æ³å®ããæ§æ
urlã¯æ¬¡ã®éã
- central repository
- https://bitbucket.org/troter/killer-app
- mirror repository
- https://github.com/troter/killer-app
- fork repository
- https://github.com/fork/killer-app
ããã§ã¯ãé çªã«æ³å®ããæ§æã«ã¤ãã¦èª¬æãã¦ããã¾ãã
åæç¨ãªãã¸ããªãå©ç¨ãã¦githubã«ãã©ã¼ãªãã¸ããªãä½æãã
ã¾ããgitã¦ã¼ã¶ã«forkãã¦ããããããgithubã«ãã©ã¼ãªãã¸ããªãä½æãã¾ãã
hg-git
mercurialã«ã¯gitã®ãªãã¸ããªãæ±ãããã®hg-gitã¨ããMercuiralæ¡å¼µãåå¨ãã¾ãã
pipãå©ç¨ããå ´åã¯æ¬¡ã®ã³ãã³ãã§mercurialã¨hg-gitãã¤ã³ã¹ãã¼ã«ãã¦
pip install mercurial hg-git
~/.hgrcã«æ¬¡ã®è¡ã追å ããã°å®äºã§ãã
[extensions] hggit =
åæç¨ãªãã¸ããª
次ã«ãhg-gitãå©ç¨ãã¦å®éã«ãã©ã¼ãªãã¸ããªãä½æãã¾ããåæç¨ãªãã¸ããªãä½æããåæç¨ãªãã¸ããªããhg-gitã使ã£ã¦ãã©ã¼ãªãã¸ããªã«pushãã¾ãã
$ hg clone https://bitbucket.org/troter/killer-app killer-app-bitbucket-github-sync # åæç¨ $ cd killer-app-bitbucket-github-sync $ hg push git+ssh://[email protected]/troter/killer-app.git
åæç¨ã®ãªãã¸ããªã®pathsã¯æ¬¡ã®ããã«è¨å®ããã¨ä¾¿å©ã§ãã
$ hg paths default = https://bitbucket.org/troter/killer-app default-push = git+ssh://[email protected]/troter/killer-app.git
å®æçã«bitbucketã®ãªãã¸ããªã¨githubã®ãªãã¸ããªã®åæãå¿ è¦ã§ããä½ããã®æ¹æ³ã§å®æçã«pull&pushãè¡ãã¾ããããã¾ããgithubã«ã¯sshãã¤ãã£ã¦pushãã¾ãã®ã§ãssh-agentãå©ç¨ããã¹ãã¬ã¼ãºãªãã§pushã§ããããã«å·¥å¤«ãã¾ãããã
# ä½ããã®æ¹æ³ã®ä¾ $ screen ruby -e 'loop { system("hg pull"); system("hg push"); sleep(3600)}'
githubã®pull requestãåãè¾¼ã
ãã©ã¼ãªãã¸ããªãç¨æãã¦æ°æ¥å¾ããããããã¨ã«pull requestããã¾ãããåãè¾¼ãã§ã¿ã¾ãããã
ã¾ããgithubã®ãã©ã¼ãªãã¸ããªã¨ãpull requestãã¦ãããªãã¸ããªãhg-gitã使ã£ã¦ã¯ãã¼ã³ãã¾ããgithubã®ãã©ã¼ãªãã¸ããªã®ã¯ãã¼ã³ã¯pull requeståãè¾¼ã¿ç¨ãªãã¸ããªã¨ãã¦å©ç¨ãã¾ãã
$ hg clone git://github.com/troter/killer-app.git killer-app-github-pull-request # pull requeståãè¾¼ã¿ç¨ $ hg clone git://github.com/fork/killer-app.git killer-app-github-pull-request-N
両æ¹ã¨ãmercurialã®ãªãã¸ããªã«ãªãã¾ãããpull requeståãè¾¼ã¿ç¨ãªãã¸ããªã§pull requestãåãè¾¼ãã§ã¿ã¾ãããã
$ cd killer-app-github-pull-request $ hg incoming ../killer-app-github-pull-request-N # åãè¾¼ãå¤æ´ã確èªãã¾ããã $ hg pull ../killer-app-github-pull-request-N # ããã㯠$ hg transplant --source ../killer-app-github-pull-request-N REV1 REV2 REV3
pull requeståãè¾¼ã¿ç¨ãªãã¸ããªã§å 容ãåé¡ãªããã°å¤æ´ãã»ã³ãã©ã«ãªãã¸ããªã«åæ ãã¾ããã»ã³ãã©ã«ãªãã¸ããªã«åæ ããã°ãåæç¨ãªãã¸ããªã«ãã£ã¦ãã©ã¼ãªãã¸ããªã«åæ ããã¾ãã
$ hg outgoing https://bitbucket.org/troter/killer-app # pull requestã®å 容ãç¢ºèª $ hg push https://bitbucket.org/troter/killer-app
æå¾ã«githubã®pull requestã«ãåãè¾¼ã¿ã¾ãããã¨è¿ä¿¡ãã¦ã¤ã·ã¥ã¼ãã¯ãã¼ãºãã¾ãããã
æ®æ®µã®ä½æ¥ã«ã¤ãã¦
æ®æ®µã®ä½æ¥ãè¡ããªãã¸ããªã«ã¤ãã¦ã¯ãåæç¨ãªãã¸ããªãpull requeståãè¾¼ã¿ç¨ã¨ã¯å¥ã®ãªãã¸ããªã§ä½æ¥ãã¾ããåããªãã¸ããªã§è¡ãå ´åãæ´æ°ã®æ¹åãåæ¹åã«ãªãã«ãªã¹ã«ãªã£ã¦ãã¾ãã¾ãã
ã¾ã¨ã
ãmercuiralã使ããªããgithubã®pull requestãåãè¾¼ãæ¹æ³ããèå¯ãã¾ããã
- å©ç¹
- 極ågitãå©ç¨ããªãæ¹æ³ãªã®ã§ãgitã®ç¥èãä¸è¦
- ãªãã¸ããªã®æ´æ°ãä¸æ¹åã«ãªã£ã¦ããã®ã§ãè¦éãããã
- git使ãã®ãã¯ãã©ãåããªãã¦æ¸ã
- æ¬ ç¹
- åæç¨ãªãã¸ããªã使ã£ã¦å®æçã«åæããå¿ è¦ããã
- ç»å ´ãããªãã¸ããªãã¡ãã£ã¨å¤ããæ¯åcloneããã®ã§ã大ãããªãã¸ããªã§ã¯ä¸å©
- åãå®éã«éç¨ãã¦ããªãã®ã§è½ã¨ãç©´ããããããã