Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Aug 29, 2007

tracd does not accept folded http header

I found that tracd does not work in some cases, specifically when the http header is folded because of its longness. To solve this problem, I modified /usr/lib/python2.4/site-packages/trac/web/wsgi.py as following.
  1. Make unfold_header function.
    def unfold_header(self):
        lineno = 1
        while lineno < len(self.headers.headers):
            header = self.headers.headers[lineno]
            if header.startswith(' ') or header.startswith('\t'):
                self.headers.headers[lineno - 1] += header
                del(self.headers.headers[lineno])
            else:
                lineno = lineno + 1
    
  2. Call this function from setup_environ function in WSGIRequestHandler class.
    length = self.headers.getheader('content-length')
    if length:
        environ['CONTENT_LENGTH'] = length
    
    # insert this line here.
    self.unfold_header()
    
    for name, value in [header.split(':', 1) for header
                        in self.headers.headers]:
    
This was my first time to program in Python, so there might be some problems. But this modified tracd is working for now.

Jul 9, 2007

running svk

Running svk is not hard, however some terms are different from svn's ones. commit is push and update is pull. These may be more intuitive terms than svn's. As I said, svk can reduce revision number of repository. To do this, use -l option for push that means merge everythins into a single commit log.
svk push -l //local/YourProject
Then you can commit your source files after changing few lines without worrying about revision number. I think this is most important thing for refactoring.

Another first step guide of svk. Simple and easy to understand. I do not need boring text but really need sample code or command. When there is something unclear, I will search official document that is more accurate, reliable one than somebody's blog.

Jul 8, 2007

install svk

I know Mercurial is a great SCM system which is called distributed one. I am using svn and commiting my code many times when I made changes. It may disturb others because revision number changes frequently. Distributed SCM systems are different, however they do not have integrated GUI like TortoiseSVN. Even if Mercurial got such interface, repositories I am working on are still svn's one. svk is a solution to use svn as distributed one. I refered these sites to install svk. At the moment, I made a copy of remote repository and checked out files from there. Revision number had been smaller. It seems that revisions are skipped which are not related to files I got from remote repository. This may be a problem when I use svn:keyword like $Id$ or $Rev$. Later, I will write about it.