MercurialãGitã®ãªãã¸ããªã¯ã©ãã©ãå¢ãã¾ããããã®ãªãã«ã¯ã´ããªãã¸ããªãããã¾ããæ´çãããã¨æã£ã¦ããããããå ¨é¨ã®ãªãã¸ããªãææ¡ãã¦ãªããããã§ã次ã®ãã¨ãå®è¡ãããã¨ã«ãã¾ãã
- Mercurialã®ãªãã¸ããªãå ¨é¨æ¢ãã¦ããã®ãã¼ã«ã«ãã¹ã¨ãªã¢ã¼ããã¹ãé©å½ãªå½¢å¼ã§åºåããã
使ã£ãã³ãã³ãã©ã¤ã³ã¯ï¼
$ find `pwd` -type d -name '.hg' | tee hg-repos.list | \
> xargs -I{} sh -c "echo $'---\nlocal = {}'; cd {}; hg paths" | tee hg-paths.list
- findã«ããååã '.hg' ã§ãããã£ã¬ã¯ããªãããã¹ã¦åºåããã¾ãã`pwd`ããã®ã¯ããã«ãã¹ãåºåãããããã§ããï¼ããã©ã«ãã§ãã«ãã¹åºåã®findãããããã§ããï¼
- findã®çµæ㯠hg-repos.list ã«ä¿åãã¦ãã¤ãã©ã¤ã³ãç¶ãã¾ãã
- findã®åºåè¡ãã¨ã«ãxargsã§å¦çãç¹°ãè¿ãã¾ãã
- -I{} ã¯ã{} ã®é¨åãfindã®åºåè¡ï¼ã®æååï¼ã¨ç½®ãæããæ示ã§ãã
- åè¡ï¼ãã£ã¬ã¯ããªã®ãã«ãã¹ï¼ãã¨ã«å®è¡ãã¹ãã³ãã³ãã¯ãsh -c "echo $'---\nlocal = {}'; cd {}; hg paths" ã
- ã¤ã¾ããã·ã§ã«ã®ã³ãã³ãã©ã¤ã³ echo $'---\nlocal = {}'; cd {}; hg paths ã§ã{}é¨åããã£ã¬ã¯ããªã®ãã«ãã¹ã«ç½®ãæãããã®ãå®è¡ãã¾ãã
- çµæã hg-paths.list ã«ä¿åãã¦æ¨æºåºåã«ãæ¸ãåºãã¾ãã
æçµåºåã¯æ¬¡ã®ããã«ãªãã¾ãããã¼ã«ã«ãã¹ã¯ãWindowsãã¡ã¤ã«ã·ã¹ãã ã®Cygwinå½¢å¼ã§ãã
--- local = /cygdrive/c/Users/hiyama/Work/Alloy/.hg --- local = /cygdrive/c/Users/hiyama/Work/configs/.hg default = https://[email protected]/m_hiyama/configs --- local = /cygdrive/c/Users/hiyama/Work/JsDev/yet-uncertain/.hg default = https://[email protected]/m_hiyama/yet-uncertain --- local = /cygdrive/c/Users/hiyama/Work/pkgsbin/.hg default = https://[email protected]/m_hiyama/pkgsbin --- . . .
[追è¨]find `pwd` -type d -name '.hg' ã®ã¾ã¾ãããªãã¦ãfind `pwd` -type d -name '.hg' | sed -e 's/.hg$//' ã¨ãã¦ãå°»ã®.hgãåãå¤ãã¦ãããã»ããè¯ãã£ãããã[/追è¨]
[ããã«è¿½è¨]追è¨ã® sed -e 's/.hg$//' ã®ã¨ããããã®å ´åã¯çµæçã«ãã¾ããã£ã¦ãã¾ãã¾ããããããããæåã®ããããã¨ãã¦æ±ããªããsed -e 's/\.hg$//' ã¨ã¨ã¹ã±ã¼ããã¹ãã§ããã[/ããã«è¿½è¨]