annotate commitwatcher/commit.py @ 45:32cf3d3469c3 default tip

assert
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 07 Nov 2013 14:19:06 -0800
parents 4f8fe143b977
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 """
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 commit object model
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 class Commit(object):
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6
43
ef90a853afd1 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 30
diff changeset
7 def __init__(self, message, datetime, author, files, revision):
2
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 self.message = message
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 self.datetime = datetime
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 self.author= author
4cb3971d9d9d commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 self.paths = paths
30
4c53f4cc6ffe commitwatcher/commit.py commitwatcher/store.py
Jeff Hammel <jhammel@mozilla.com>
parents: 20
diff changeset
12 self.revision = revision
43
ef90a853afd1 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 30
diff changeset
13
ef90a853afd1 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 30
diff changeset
14 def ancestry(self, ):
ef90a853afd1 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 30
diff changeset
15 sep = '/' # unix/url-style separators
ef90a853afd1 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 30
diff changeset
16 path = path.split('/')
ef90a853afd1 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 30
diff changeset
17 paths = []
ef90a853afd1 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 30
diff changeset
18 while path:
ef90a853afd1 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 30
diff changeset
19 paths.append(sep.join(path))
ef90a853afd1 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 30
diff changeset
20 path.pop()
ef90a853afd1 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 30
diff changeset
21 return paths