Trac0.12ã¨svnã®é£æº
ãªããTracã¯0.12ããå¤é¨ãªãã¸ããªé£æºã®æ¹æ³ãå¤ããããããããæãã®æ¥æ¬èªããã¥ã¡ã³ãããªãã£ãã®ã§ãç°¡åã«æ¸ãã¦ã¿ãã
svn-tracé£æºæ¹æ³ã¯ trac 0.12 ããæ¹æ³ãå¤ãããtrac-post-commit-hook ãã©ã°ã¤ã³ã使ç¨ã§ããªããªãã¾ããã
代ããã«ãTracCoreã«çµã¿è¾¼ã¾ãã¦ããCommitTicketUpdater, CommitticketReferenceMacroã使ç¨ãã¾ãã
ç°¡åãªæ§é
SVNããã¯ãã³ãããå¾ï¼post-commit hookï¼ã«ãTracã«å¯¾ãã¦ãã³ããããã£ããã¼ããã¨ããé£æºããã¾ããï¼trac-adminã«ããchangeseté£æºï¼
Tracã¯ãé£æºãåããã¨ã対å¿ããsvnã確èªãã¦åè¿°ã®ãã©ã°ã¤ã³ãèµ°ããããã¨ã§ãå¿
è¦ãªå¯¾å¿ãè¡ãã¾ãã
ããã§ãã³ã¡ã³ãå
容ï¼tracãã©ã°ã¤ã³ç¨ã®ã³ãã³ãï¼refsã¨ãï¼ã¯Tracãsvnãåç
§ãã¦ç解ããã®ã§ãå
ã«Tracã«svnãªãã¸ããªãç»é²ãã¦ããå¿
è¦ãããã¾ãã
ã¤ã¾ãã対å¿ããæé ã¨ãã¦ã¯ãããªæãã«ãªãã¾ãã
- Tracã«(svn)ãªãã¸ããªãç»é²
- svnã®hookãã¤ã³ããå©ç¨ããã³ãããå¾ã«Tracã¸é£æºï¼ãã®ã¨ãããªãã¸ããªåã¨ãªãã¸ã§ã³çªå·ãé£æºããï¼
- Tracã¯é£æºãåãã¦ã対å¿ãããªãã¸ããªåã®ãªãã¸ããªã®ãªãã¸ã§ã³çªå·ãæ¤ç´¢ãããã®ã³ã¡ã³ãå ã«æ¸ããã¦ããã³ãã³ãï¼refsã¨ãï¼ãå¤æãã¦å®è¡
以ä¸ãããããã®å ·ä½çãªå 容ãæ¸ãã¾ãã
詳細æé ã¡ã¢
- Tracã«(svn)ãªãã¸ããªãç»é²
- Tracã®ã¤ã³ã¿ãã§ã¼ã¹ã«ç®¡çè ã§ãã°ã¤ã³
- 管çï¼ãªãã¸ããªããé¸æ
- ãªãã¸ããªã®è¿½å ã§ãååã¨ç¨®å¥ãé ç½®ããã¦ãããã£ã¬ã¯ããªï¼ãããã¯ä»ãµã¼ãã®å ´åã¯åç §URLï¼ãè¨è¿°ãããã§ã¯ååããrepoãã¨ããã
- svnã®hookãã¤ã³ããå©ç¨ããã³ãããå¾ã«Tracã¸é£æºï¼ãã®ã¨ãããªãã¸ããªåã¨ãªãã¸ã§ã³çªå·ãé£æºããï¼
- svnãªãã¸ããªé ä¸ã«ãã hooks ãã©ã«ãé ä¸ã«ãå¾ã§æ¸ãã¦ãããããªå 容㮠post-commit ã¨ãããã¡ã¤ã«ãç½®ãããã ããENVã¯Tracã®ãã¼ã ãã£ã¬ã¯ããªï¼ä¸ã«VERSIONãã¡ã¤ã«ãããã¨ããï¼ã"repo"㯠1. ã§ç»é²ãããªãã¸ããªã®ååï¼tracã解éã§ãããã®ï¼ã§ããå¿ è¦ããã
3.Tracã¯é£æºãåãã¦ã対å¿ãããªãã¸ããªåã®ãªãã¸ããªã®ãªãã¸ã§ã³çªå·ãæ¤ç´¢ãããã®ã³ã¡ã³ãå ã«æ¸ããã¦ããã³ãã³ãï¼refsã¨ãï¼ãå¤æãã¦å®è¡
-
- TracWebã¤ã³ã¿ãã§ã¼ã¹ã«ç®¡çè ã§ãã°ã¤ã³ããã
- 管çï¼ãã©ã°ã¤ã³ï¼Trac x.x.x ãéã
- ä¸ã®æ¹ã® tracopt.ticket.commit_updater.* ã«ãããCommitTicketReferenceMacro, CommitTicketUpdater ã«ãã§ãã¯ãå ¥ãããå¤æ´ãé©ç¨ã
post-commitã¯ãããªæãã
REPOS="$1"
REV="$2"
ENV="/home/tracuser/cloud_ph1"
trac-admin $ENV changeset added "repo" $REV
ãã¾ãã®ãã¾ãï¼closeã®åæ¢ã¨resolved対å¿
ããã©ã«ãã§ã¯ä¸è¨ãã©ã°ã¤ã³ãæã£ã¦ããæ©è½ã¯
- ãã±ããã«ãªãã¸ããªã®ã³ã¡ã³ããé£æºãã
- ãã±ãããã¯ãã¼ãºãã
ã§ãããä»å対å¿ããã±ã¼ã¹ã§ã¯ããã±ããã¯ãã¼ãºã¯ããã¼ã¸ã£ããããã®ã§ãåæã«ã¯ãã¼ãºããã¦ã¯å°ã£ãããã¾ããããããããªãã¦ã¹ãã¼ã¿ã¹ãresolvedã«ã¯ããããå°ã£ãå°ã£ãã
ã¨ãããã¨ã§ããã©ã°ã¤ã³æ¸ãæãã¾ããã
vi /usr/local/lib/python2.6/dist-packages/Trac-0.12.2.ja1-py2.6.egg/tracopt/ticket/commit_updater.py
ããdef cmd_close(self, ticket, changeset, perm):
ããããif not self.check_perms or 'TICKET_MODIFY' in perm:
ããããããticket['status'] = 'resolved'ããããããããã<== ãã
ããããããif not ticket['owner']:
ããããããããticket['owner'] = changeset.author
ããã§ã¹ãã¼ã¿ã¹å¤æ´å¯¾è±¡ã close ãããªã㦠resolved ã«ãªãã¾ããã
ãã¨ãããã©ã«ãã§ã¯ãã®ãã±ããã¹ãã¼ã¿ã¹å¤æ´ç¨ã®ã³ãã³ãããcloseãã¨ãã§æ°æã¡æªãã®ã§ãtrac.iniã«ãããªæãã§è¿½å ã
commit_ticket_update_commands.close = resolved resolve solve fix fixed fixes
é¢æ°åãå¤æ°åã close ã§å¤å°æ°æã¡æªããã©ãCore ã©ã¤ãã©ãªãå¿ è¦ä»¥ä¸ã«ãããã®ãæ°ãå¼ãããããããªããã§ããã