changeset 7894:f00117816704

Merge stable
author Mads Kiilerich <mads@kiilerich.com>
date Fri, 27 Sep 2019 01:12:38 +0200
parents cae722ba3817 (current diff) 3b4932dad406 (diff)
children 0288dd052033
files kallithea/controllers/pullrequests.py kallithea/i18n/de/LC_MESSAGES/kallithea.po kallithea/i18n/el/LC_MESSAGES/kallithea.po kallithea/i18n/zh_CN/LC_MESSAGES/kallithea.po kallithea/model/user.py
diffstat 2 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/pullrequests.py	Fri Sep 27 01:08:52 2019 +0200
+++ b/kallithea/controllers/pullrequests.py	Fri Sep 27 01:12:38 2019 +0200
@@ -530,9 +530,14 @@
                             # Note: org_scm_instance.path must come first so all
                             # valid revision numbers are 100% org_scm compatible
                             # - both for avail_revs and for revset results
-                            hgrepo = unionrepo.unionrepository(org_scm_instance.baseui,
-                                                               org_scm_instance.path,
-                                                               other_scm_instance.path)
+                            try:
+                                hgrepo = unionrepo.makeunionrepository(org_scm_instance.baseui,
+                                                                       org_scm_instance.path,
+                                                                       other_scm_instance.path)
+                            except AttributeError: # makeunionrepository was introduced in Mercurial 4.8 23f2299e9e53
+                                hgrepo = unionrepo.unionrepository(org_scm_instance.baseui,
+                                                                   org_scm_instance.path,
+                                                                   other_scm_instance.path)
                         else:
                             hgrepo = org_scm_instance._repo
                         show = set(hgrepo.revs('::%ld & !::parents(%s) & !::%s',
--- a/kallithea/model/user.py	Fri Sep 27 01:08:52 2019 +0200
+++ b/kallithea/model/user.py	Fri Sep 27 01:12:38 2019 +0200
@@ -38,7 +38,7 @@
 
 from kallithea.lib.caching_query import FromCache
 from kallithea.lib.exceptions import DefaultUserException, UserOwnsReposException
-from kallithea.lib.utils2 import generate_api_key, get_current_authuser, safe_str
+from kallithea.lib.utils2 import generate_api_key, get_current_authuser, safe_unicode
 from kallithea.model.db import Permission, User, UserEmailMap, UserIpMap, UserToPerm
 from kallithea.model.meta import Session
 
@@ -142,9 +142,9 @@
             new_user.admin = admin
             new_user.email = email
             new_user.active = active
-            new_user.extern_name = safe_str(extern_name) \
+            new_user.extern_name = safe_unicode(extern_name) \
                 if extern_name else None
-            new_user.extern_type = safe_str(extern_type) \
+            new_user.extern_type = safe_unicode(extern_type) \
                 if extern_type else None
             new_user.name = firstname
             new_user.lastname = lastname