comparison rhodecode/model/db.py @ 3636:ddc4c12f00fb beta

fixed issues with importing non-ascii repo names
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 29 Mar 2013 23:49:21 +0100
parents 10b4e34841a4
children 0db18ba129ea 3563bb7b4b82
comparison
equal deleted inserted replaced
3635:be78bf3b1a1f 3636:ddc4c12f00fb
905 p = [self.repo_path] 905 p = [self.repo_path]
906 # we need to split the name by / since this is how we store the 906 # we need to split the name by / since this is how we store the
907 # names in the database, but that eventually needs to be converted 907 # names in the database, but that eventually needs to be converted
908 # into a valid system path 908 # into a valid system path
909 p += self.repo_name.split(Repository.url_sep()) 909 p += self.repo_name.split(Repository.url_sep())
910 return os.path.join(*p) 910 return os.path.join(*map(safe_unicode, p))
911 911
912 @property 912 @property
913 def cache_keys(self): 913 def cache_keys(self):
914 """ 914 """
915 Returns associated cache keys for that repo 915 Returns associated cache keys for that repo
1060 cs_cache = cs_cache.__json__() 1060 cs_cache = cs_cache.__json__()
1061 1061
1062 if (cs_cache != self.changeset_cache or not self.changeset_cache): 1062 if (cs_cache != self.changeset_cache or not self.changeset_cache):
1063 _default = datetime.datetime.fromtimestamp(0) 1063 _default = datetime.datetime.fromtimestamp(0)
1064 last_change = cs_cache.get('date') or _default 1064 last_change = cs_cache.get('date') or _default
1065 log.debug('updated repo %s with new cs cache %s' % (self, cs_cache)) 1065 log.debug('updated repo %s with new cs cache %s'
1066 % (self.repo_name, cs_cache))
1066 self.updated_on = last_change 1067 self.updated_on = last_change
1067 self.changeset_cache = cs_cache 1068 self.changeset_cache = cs_cache
1068 Session().add(self) 1069 Session().add(self)
1069 Session().commit() 1070 Session().commit()
1070 else: 1071 else:
1071 log.debug('Skipping repo:%s already with latest changes' % self) 1072 log.debug('Skipping repo:%s already with latest changes'
1073 % self.repo_name)
1072 1074
1073 @property 1075 @property
1074 def tip(self): 1076 def tip(self):
1075 return self.get_changeset('tip') 1077 return self.get_changeset('tip')
1076 1078