Permalink
Browse files

Merge branch 'feature/bug-731989-mercurial-2.1' into develop

  • Loading branch information...
Pike committed Apr 13, 2012
2 parents a4c8cc4 + 50902d0 commit d603cbaecf23c627b92fb3b6897f0bf6b8ea9cf6
@@ -65,7 +65,7 @@ def handle(self, *args, **options):
else:
pull_args = []
from life.models import Repository, Changeset
- from pushes.management import hgcompat
+ from mercurial import dispatch
import os.path
from django.conf import settings
@@ -98,8 +98,12 @@ def resolve(path):
print ("\n\nFailed to prepare for clone, %s\n\n"
% str(e))
continue
- hgcompat.dispatch(['clone', str(url), repopath])
+ dispatch.dispatch(
+ dispatch.request(['clone', str(url), repopath])
+ )
else:
- hgcompat.dispatch(['pull', '-R', repopath] + pull_args)
+ dispatch.dispatch(
+ dispatch.request(['pull', '-R', repopath] + pull_args)
+ )
open(resolve('.latest_cs'), 'w').write('%i\n' % latest_cs)
@@ -1,48 +0,0 @@
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is l10n django site.
-#
-# The Initial Developer of the Original Code is
-# Mozilla Foundation.
-# Portions created by the Initial Developer are Copyright (C) 2011
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Axel Hecht <l10n@mozilla.com>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-"""Code snippets to work around changes between different versions of
-mercurial.
-"""
-
-from mercurial import dispatch as _dispatch
-if hasattr(_dispatch, 'request'):
- def dispatch(*args):
- return _dispatch.dispatch(_dispatch.request(*args))
-else:
- def dispatch(*args):
- return _dispatch.dispatch(*args)
View
@@ -41,10 +41,7 @@
import os.path
from mercurial.hg import repository
from mercurial.ui import ui
-try:
- from mercurial.repo import RepoError
-except ImportError:
- from mercurial.error import RepoError
+from mercurial.error import RepoError
from mercurial.commands import pull, update, clone
from life.models import Repository, Push, Changeset, Branch, File
@@ -51,8 +51,7 @@
from mercurial.ui import ui as _ui
from mercurial.hg import repository
-from mercurial.node import nullid
-from mercurial.copies import copies as _copies
+from mercurial.copies import pathcopies
from Mozilla.Parser import getParser
from Mozilla.CompareLocales import AddRemove, Tree as DataTree
@@ -84,7 +83,7 @@ def diff(request):
# This prevents UnicodeWarning messages.
ctx1 = repo.changectx(str(request.GET['from']))
ctx2 = repo.changectx(str(request.GET['to']))
- copies = _copies(repo, ctx1, ctx2, repo[nullid])[0]
+ copies = pathcopies(ctx1, ctx2)
match = None # maybe get something from l10n.ini and cmdutil
changed, added, removed = repo.status(ctx1, ctx2, match=match)[:3]
@@ -75,8 +75,10 @@ def resolve(path):
sos=dict(sos.values_list('locale__code', 'push_id'))
tips = dict(Push.objects.filter(id__in=sos.values()).annotate(tip=Max('changesets__id')).values_list('id', 'tip'))
revs = dict(Changeset.objects.filter(id__in=tips.values()).values_list('id','revision'))
- from pushes.management import hgcompat
+ from mercurial import dispatch
for loc in sorted(sos.keys()):
repopath = resolve(loc)
rev = revs[tips[sos[loc]]]
- hgcompat.dispatch(['update', '-R', repopath, '-r', rev])
+ dispatch.dispatch(
+ dispatch.request(['update', '-R', repopath, '-r', rev])
+ )
@@ -8,5 +8,5 @@ hmac==20101005
hashlib==20081119
py-bcrypt==0.2
-mercurial
+mercurial==2.1.2
python-ldap

0 comments on commit d603cba

Please sign in to comment.