changeset 2693:66c778b8cb54 beta

Extended commit search schema with date of commit
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 04 Aug 2012 21:39:05 +0200
parents 1f75b23c3e26
children 78694f9acd31
files rhodecode/lib/indexers/__init__.py rhodecode/lib/indexers/daemon.py rhodecode/lib/vcs/backends/git/changeset.py rhodecode/lib/vcs/backends/hg/changeset.py
diffstat 4 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/indexers/__init__.py	Sat Aug 04 21:02:24 2012 +0200
+++ b/rhodecode/lib/indexers/__init__.py	Sat Aug 04 21:39:05 2012 +0200
@@ -74,6 +74,7 @@
 
 CHGSETS_SCHEMA = Schema(
     raw_id=ID(unique=True, stored=True),
+    date=NUMERIC(stored=True),
     last=BOOLEAN(),
     owner=TEXT(),
     repository=ID(unique=True, stored=True),
--- a/rhodecode/lib/indexers/daemon.py	Sat Aug 04 21:02:24 2012 +0200
+++ b/rhodecode/lib/indexers/daemon.py	Sat Aug 04 21:39:05 2012 +0200
@@ -196,6 +196,7 @@
             writer.add_document(
                 raw_id=unicode(cs.raw_id),
                 owner=unicode(repo.contact),
+                date=cs._timestamp,
                 repository=safe_unicode(repo_name),
                 author=cs.author,
                 message=cs.message,
--- a/rhodecode/lib/vcs/backends/git/changeset.py	Sat Aug 04 21:02:24 2012 +0200
+++ b/rhodecode/lib/vcs/backends/git/changeset.py	Sat Aug 04 21:39:05 2012 +0200
@@ -60,6 +60,10 @@
                                   getattr(self._commit, self._date_tz_property))
 
     @LazyProperty
+    def _timestamp(self):
+        return getattr(self._commit, self._date_property)
+
+    @LazyProperty
     def status(self):
         """
         Returns modified, added, removed, deleted files for current changeset
--- a/rhodecode/lib/vcs/backends/hg/changeset.py	Sat Aug 04 21:02:24 2012 +0200
+++ b/rhodecode/lib/vcs/backends/hg/changeset.py	Sat Aug 04 21:39:05 2012 +0200
@@ -52,6 +52,10 @@
         return date_fromtimestamp(*self._ctx.date())
 
     @LazyProperty
+    def _timestamp(self):
+        return self._ctx.date()[0]
+
+    @LazyProperty
     def status(self):
         """
         Returns modified, added, removed, deleted files for current changeset