public
Description: A distributed issue tracking system based on Git repositories, written in Python
Homepage: http://www.newartisans.com/software.html
Clone URL: git://github.com/jwiegley/git-issues.git
Search Repo:
Click here to lend your support to: git-issues and make a donation at www.pledgie.com !
git-issues is now using gitshelve.py.
jwiegley (author)
Wed May 14 20:41:47 -0700 2008
commit  3bb555354d53c2a73d0a73d7ce375603b066d980
tree    e599491b6c0d766e3c2843f72aa4428f9a04943c
parent  9f6565fc677f44f26c78a8be488a303cc0e30a77
...
128
129
130
 
 
 
131
132
133
...
260
261
262
263
 
 
264
265
266
...
695
696
697
698
 
 
 
 
 
 
 
 
 
 
699
700
701
...
708
709
710
711
 
 
712
713
714
...
801
802
803
804
 
805
806
807
...
128
129
130
131
132
133
134
135
136
...
263
264
265
 
266
267
268
269
270
...
699
700
701
 
702
703
704
705
706
707
708
709
710
711
712
713
714
...
721
722
723
 
724
725
726
727
728
...
815
816
817
 
818
819
820
821
0
@@ -128,6 +128,9 @@
0
             self.modified = datetime.now()
0
         self.issueSet.mark_dirty(self_dirty = False)
0
 
0
+ def get_name(self):
0
+ assert False
0
+
0
     def note_change(self, field, before, after):
0
         if self.changes.has_key(field):
0
             data = self.changes[field]
0
@@ -260,7 +263,8 @@
0
         return issue
0
 
0
     def issue_path(self, issue):
0
- return '%s/%s/issue.xml' % (issue.name[:2], issue.name[2:])
0
+ name = issue.get_name()
0
+ return '%s/%s/issue.xml' % (name[:2], name[2:])
0
 
0
     def add_issue(self, issue):
0
         self.shelf[self.issue_path(issue)] = issue
0
@@ -695,7 +699,16 @@
0
 
0
 ######################################################################
0
 
0
-class GitIssue(Issue, gitshelve.gitbook):
0
+class GitIssue(Issue):
0
+ def get_name(self):
0
+ if not self.name:
0
+ hash_func = self.issueSet.shelf.hash_blob
0
+ name = hash_func(str(self.created) + str(self.author) +
0
+ self.title)
0
+ self.name = name
0
+ return self.name
0
+
0
+class xml_gitbook(gitshelve.gitbook):
0
     def serialize_data(self):
0
         return object_to_string(self.data)
0
 
0
@@ -708,7 +721,8 @@
0
     def __init__(self):
0
         self.GIT_DIR = None
0
         self.GIT_AUTHOR = None
0
- IssueSet.__init__(self, gitshelve.open('issues', book_type = GitIssue))
0
+ IssueSet.__init__(self, gitshelve.open('issues',
0
+ book_type = xml_gitbook))
0
 
0
     def git_directory(self):
0
         if self.GIT_DIR is None:
0
@@ -801,7 +815,7 @@
0
 
0
         index = 1
0
         for item in issueSet.shelf.iteritems():
0
- issue = item[1]
0
+ issue = item[1].get_data()
0
             print "%4d %s %-23s %-6s %5s %6s %s" % \
0
                 (index, issue.name[:7], issue.title, issue.status,
0
                  issue.created and issue.created.strftime('%m/%d'),
...
224
225
226
 
 
 
227
228
229
...
224
225
226
227
228
229
230
231
232
0
@@ -224,6 +224,9 @@
0
     def get_blob(self, name):
0
         return git('cat-file', 'blob', name, keep_newline = True)
0
 
0
+ def hash_blob(self, data):
0
+ return git('hash-object', '--stdin', input = data)
0
+
0
     def make_blob(self, data):
0
         return git('hash-object', '-w', '--stdin', input = data)
0
 

Comments

    No one has commented yet.