Control: tags -1 pending
Control: tags 915858 pending
Control: tags 909583 pending

Hi,

On 20/11/2018 15:01, Julien Cristau wrote:
> Package: tortoisehg
> Version: 4.7-0.1
> Severity: serious
> 
> Hi,
> 
> I just uploaded mercurial 4.8 to sid, tortoisehg will be uninstallable.

I have just uploaded the attached NMU to DELAYED/2 which upgrades
tortoisehg to 4.8.1 which will fix this (and the other two bugs above).
Please tell me if you want me to cancel it.

I've pushed my changes to salsa (and dgit repos), and I attach the full
debdiff and a shorter version containing just the changes to the debian/
directory.

Thanks,
James
diff -Nru tortoisehg-4.7/PKG-INFO tortoisehg-4.8.1/PKG-INFO
--- tortoisehg-4.7/PKG-INFO     2018-08-20 04:03:06.000000000 +0100
+++ tortoisehg-4.8.1/PKG-INFO   2018-12-10 15:10:00.000000000 +0000
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: tortoisehg
-Version: 4.7
+Version: 4.8.1
 Summary: TortoiseHg dialogs for Mercurial VCS
 Home-page: https://tortoisehg.bitbucket.io
 Author: Steve Borho
diff -Nru tortoisehg-4.7/debian/changelog tortoisehg-4.8.1/debian/changelog
--- tortoisehg-4.7/debian/changelog     2018-09-01 16:37:37.000000000 +0100
+++ tortoisehg-4.8.1/debian/changelog   2018-12-22 11:21:56.000000000 +0000
@@ -1,3 +1,21 @@
+tortoisehg (4.8.1-0.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+
+  [ James Cowgill ]
+  * New upstream version. (Closes: #909583)
+  * d/control:
+    - Update mercurial dependency to allow 4.7 and 4.8. (Closes: #914200)
+
+  [ Ondřej Nový ]
+  * d/control: Remove ancient X-Python-Version field.
+  * d/copyright: Use https protocol in Format field.
+
+  [ Stéphane Blondon ]
+  * d/thg.1.xml: Uudate link to upstream BTS in the manpage. (Closes: #915858)
+
+ -- James Cowgill <jcowg...@debian.org>  Sat, 22 Dec 2018 11:21:56 +0000
+
 tortoisehg (4.7-0.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru tortoisehg-4.7/debian/control tortoisehg-4.8.1/debian/control
--- tortoisehg-4.7/debian/control       2018-09-01 16:36:09.000000000 +0100
+++ tortoisehg-4.8.1/debian/control     2018-12-22 11:21:56.000000000 +0000
@@ -14,11 +14,10 @@
 Homepage: https://tortoisehg.bitbucket.io
 Vcs-Git: https://salsa.debian.org/debian/tortoisehg.git
 Vcs-Browser: https://salsa.debian.org/debian/tortoisehg
-X-Python-Version: >= 2.4
 
 Package: tortoisehg
 Architecture: all
-Depends: mercurial (>= 4.7~), mercurial (<< 4.8~), python-pyqt5,
+Depends: mercurial (>= 4.7~), mercurial (<< 4.9~), python-pyqt5,
  python-pyqt5.qsci, ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
 Recommends: libjs-jquery, libjs-underscore, python-iniparse, python-pygments
 Suggests: tortoisehg-nautilus
diff -Nru tortoisehg-4.7/debian/copyright tortoisehg-4.8.1/debian/copyright
--- tortoisehg-4.7/debian/copyright     2018-08-30 09:14:34.000000000 +0100
+++ tortoisehg-4.8.1/debian/copyright   2018-12-22 11:21:56.000000000 +0000
@@ -1,4 +1,4 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: TortoiseHg
 Upstream-Contact: Maintainer: Steve Borho <st...@borho.org>, TK Soh 
<teekay...@gmail.com>
 Source: https://tortoisehg.bitbucket.io/download/source.html
diff -Nru tortoisehg-4.7/debian/thg.1.xml tortoisehg-4.8.1/debian/thg.1.xml
--- tortoisehg-4.7/debian/thg.1.xml     2018-08-30 09:14:34.000000000 +0100
+++ tortoisehg-4.8.1/debian/thg.1.xml   2018-12-22 11:21:56.000000000 +0000
@@ -453,7 +453,7 @@
     <!-- Or use this section to tell about upstream BTS. -->
     <title>BUGS</title>
     <para>The upstreams <acronym>BTS</acronym> can be found
-      at <ulink url="http://bitbucket.org/tortoisehg/stable/issues/"/>.</para>
+      at <ulink url="https://bitbucket.org/tortoisehg/thg/issues"/>.</para>
   </refsect1>
   <refsect1 id="see_also">
     <title>SEE ALSO</title>
diff -Nru tortoisehg-4.7/doc/source/conf.py tortoisehg-4.8.1/doc/source/conf.py
--- tortoisehg-4.7/doc/source/conf.py   2018-02-02 17:35:52.000000000 +0000
+++ tortoisehg-4.8.1/doc/source/conf.py 2018-12-10 15:09:54.000000000 +0000
@@ -49,9 +49,9 @@
 # built documents.
 #
 # The short X.Y version.
-version = '3.8'
+version = '4.7'
 # The full version, including alpha/beta/rc tags.
-release = '3.8.0'
+release = '4.7.0'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff -Nru tortoisehg-4.7/doc/source/preface.txt 
tortoisehg-4.8.1/doc/source/preface.txt
--- tortoisehg-4.7/doc/source/preface.txt       2017-03-29 01:25:22.000000000 
+0100
+++ tortoisehg-4.8.1/doc/source/preface.txt     2018-12-10 15:09:54.000000000 
+0000
@@ -52,11 +52,9 @@
 Community
 =========
 
-Mailing Lists:
+Mailing List::
 
-* `Users <https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss>`_ - 
Announcements, user Q&A, and feature discussions.
-* `Developers <thg-...@googlegroups.com>`_ - Patches, bug reports, development 
discussions.
-* `Issues <https://lists.sourceforge.net/lists/listinfo/tortoisehg-issues>`_ - 
Notifications from the issue tracker.
+       `Developers <thg-...@googlegroups.com>`_ - Patches, bug reports, 
development discussions.
 
 And our `wiki <https://bitbucket.org/tortoisehg/thg/wiki/Home>`_ on Bitbucket.
 
diff -Nru tortoisehg-4.7/doc/source-cs/preface.txt 
tortoisehg-4.8.1/doc/source-cs/preface.txt
--- tortoisehg-4.7/doc/source-cs/preface.txt    2017-03-29 01:25:22.000000000 
+0100
+++ tortoisehg-4.8.1/doc/source-cs/preface.txt  2018-12-10 15:09:54.000000000 
+0000
@@ -45,12 +45,6 @@
 Komunita
 ========
 
-Adresy:
-
-* `Uživatelé 
<https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss>`_ - Oznámení, 
otázky-odpovědi a diskuze o vlastnostech
-* `Vývojáři 
<https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop>`_ - Oprávky, 
zprávy o chybách a diskuze o vývoji programu.
-* `Problémy <https://lists.sourceforge.net/lists/listinfo/tortoisehg-issues>`_ 
- Přehled zaznamenávaných problémů.
-
 Naše Wiki na stránkách Bitbucket je `zde 
<https://bitbucket.org/tortoisehg/thg/wiki/Home>`_ .
 
 Poděkování
diff -Nru tortoisehg-4.7/doc/source-ja/preface.txt 
tortoisehg-4.8.1/doc/source-ja/preface.txt
--- tortoisehg-4.7/doc/source-ja/preface.txt    2017-03-29 01:25:22.000000000 
+0100
+++ tortoisehg-4.8.1/doc/source-ja/preface.txt  2018-12-10 15:09:54.000000000 
+0000
@@ -57,12 +57,6 @@
 コミュニティ
 ============
 
-メーリングリスト:
-
-* `利用者 ML <https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss>`_ 
- アナウンス、使い方などの質問、機能の議論など。
-* `開発者 ML <https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop>`_ 
- パッチ投稿、バグ報告、開発関連の議論など。
-* `バグ通知 ML <https://lists.sourceforge.net/lists/listinfo/tortoisehg-issues>`_ 
- バグ管理システムからの自動通知メール。
-
 Bitbucket には `公式 Wiki <https://bitbucket.org/tortoisehg/thg/wiki/Home>`_ もあります。
 日本語 Wiki は `こちら <https://bitbucket.org/kuy/thg-ja/wiki/Home>`_ になります。
 
diff -Nru tortoisehg-4.7/hgext3rd/thg.py tortoisehg-4.8.1/hgext3rd/thg.py
--- tortoisehg-4.7/hgext3rd/thg.py      2018-08-18 20:51:20.000000000 +0100
+++ tortoisehg-4.8.1/hgext3rd/thg.py    2018-12-10 15:09:54.000000000 +0000
@@ -54,12 +54,7 @@
 import threading
 
 from mercurial import demandimport
-try:
-    _updateignores = demandimport.IGNORES.update
-except AttributeError:
-    # hg<4.7 (670eb4fa1b86)
-    _updateignores = demandimport.ignore.extend
-_updateignores([
+demandimport.IGNORES.update([
     'win32com.shell',
     'numpy',  # comtypes.npsupport does try-import
     'tortoisehg.util.config',
diff -Nru tortoisehg-4.7/thg tortoisehg-4.8.1/thg
--- tortoisehg-4.7/thg  2018-08-18 20:51:20.000000000 +0100
+++ tortoisehg-4.8.1/thg        2018-12-10 15:09:54.000000000 +0000
@@ -59,12 +59,7 @@
 import threading
 
 from mercurial import demandimport
-try:
-    _updateignores = demandimport.IGNORES.update
-except AttributeError:
-    # hg<4.7 (670eb4fa1b86)
-    _updateignores = demandimport.ignore.extend
-_updateignores([
+demandimport.IGNORES.update([
     'win32com.shell',
     'numpy',  # comtypes.npsupport does try-import
     'tortoisehg.util.config',
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/about.py 
tortoisehg-4.8.1/tortoisehg/hgqt/about.py
--- tortoisehg-4.7/tortoisehg/hgqt/about.py     2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/about.py   2018-12-10 15:09:54.000000000 
+0000
@@ -169,9 +169,7 @@
         except (IndexError, ImportError, ValueError):
             pass
         try:
-            thgv = version.version()
-            if '+' in thgv:
-                thgv = thgv[:thgv.index('+')]
+            thgv = version.package_version()
             curver = tuple([int(p) for p in thgv.split('.')])
         except ValueError:
             curver = (0,0,0)
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/bisect.py 
tortoisehg-4.8.1/tortoisehg/hgqt/bisect.py
--- tortoisehg-4.7/tortoisehg/hgqt/bisect.py    2018-04-29 04:23:40.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/bisect.py  2018-12-10 15:09:54.000000000 
+0000
@@ -26,6 +26,7 @@
 
 from mercurial import (
     error,
+    scmutil,
 )
 
 from ..util import hglib
@@ -157,7 +158,7 @@
 
     def _lookupRevision(self, changeid):
         try:
-            ctx = self.repo[hglib.fromunicode(changeid)]
+            ctx = scmutil.revsymbol(self.repo, hglib.fromunicode(changeid))
             return ctx.rev()
         except (error.LookupError, error.RepoLookupError), e:
             self._stbar.showMessage(hglib.tounicode(str(e)))
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/clone.py 
tortoisehg-4.8.1/tortoisehg/hgqt/clone.py
--- tortoisehg-4.7/tortoisehg/hgqt/clone.py     2018-01-16 02:24:52.000000000 
+0000
+++ tortoisehg-4.8.1/tortoisehg/hgqt/clone.py   2018-12-10 15:09:54.000000000 
+0000
@@ -76,7 +76,8 @@
         self._cmdagent = cmdagent
         self.ui = ui
 
-        dest = src = os.getcwd()
+        dest = src = (self.ui.config('tortoisehg', 'defaultclonedest')
+                      or os.getcwd())
         if args:
             if len(args) > 1:
                 src = args[0]
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/commit.py 
tortoisehg-4.8.1/tortoisehg/hgqt/commit.py
--- tortoisehg-4.7/tortoisehg/hgqt/commit.py    2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/commit.py  2018-12-10 15:09:54.000000000 
+0000
@@ -56,6 +56,7 @@
     error,
     obsolete,  # delete if obsolete becomes enabled by default
     phases,
+    scmutil,
 )
 from mercurial.utils import (
     dateutil,
@@ -569,7 +570,8 @@
             if branch in [p.branch() for p in repo[None].parents()]:
                 resp = 0
             else:
-                rev = repo[branch].rev()
+                # TODO: should look up only in branch namespace
+                rev = scmutil.revsymbol(repo, branch).rev()
                 resp = qtlib.CustomPrompt(_('Confirm Branch Change'),
                     _('Named branch "%s" already exists, '
                       'last used in revision %d\n'
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/docklog.py 
tortoisehg-4.8.1/tortoisehg/hgqt/docklog.py
--- tortoisehg-4.7/tortoisehg/hgqt/docklog.py   2017-08-19 16:31:40.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/docklog.py 2018-12-10 15:09:54.000000000 
+0000
@@ -336,6 +336,7 @@
             matchinfo = {}
             for cmdspec in cmdtable:
                 for cmdname in cmdspec.split('|'):
+                    # TODO: switch to hg>=4.8 (fa88170c10bb) syntax
                     if cmdname[0] == '^':
                         cmdname = cmdname[1:]
                     if cmdname.startswith(cmdstart):
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/filedata.py 
tortoisehg-4.8.1/tortoisehg/hgqt/filedata.py
--- tortoisehg-4.7/tortoisehg/hgqt/filedata.py  2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/filedata.py        2018-12-10 
15:09:54.000000000 +0000
@@ -226,13 +226,7 @@
     def _checkMaxDiff(self, ctx, wfile, maxdiff, force):
         self.error = None
         fctx = ctx.filectx(wfile)
-        if ctx.rev() is None:
-            size = fctx.size()
-        else:
-            # fctx.size() can read all data into memory in rename cases so
-            # we read the size directly from the filelog, this is deeper
-            # under the API than I prefer to go, but seems necessary
-            size = fctx._filelog.rawsize(fctx.filerev())
+        size = hglib.getestimatedsize(fctx)
         if not force and size > maxdiff:
             raise _BadContent(_('File is larger than the specified max size.\n'
                                 'maxdiff = %s KB') % (maxdiff // 1024))
@@ -312,7 +306,7 @@
         if status in ('R', '!'):
             if wfile in ctx.p1():
                 fctx = ctx.p1()[wfile]
-                if fctx._filelog.rawsize(fctx.filerev()) > maxdiff:
+                if hglib.getestimatedsize(fctx) > maxdiff:
                     self.error = mde
                 else:
                     olddata = fctx.data()
@@ -380,7 +374,7 @@
 
         self.olddata = olddata
         if changeselect:
-            diffopts = patch.diffopts(repo.ui, {})
+            diffopts = patch.difffeatureopts(repo.ui)
             diffopts.git = True
             m = match.exact(repo.root, repo.root, [wfile])
             fp = cStringIO.StringIO()
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/filedialogs.py 
tortoisehg-4.8.1/tortoisehg/hgqt/filedialogs.py
--- tortoisehg-4.7/tortoisehg/hgqt/filedialogs.py       2018-04-29 
04:23:40.000000000 +0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/filedialogs.py     2018-12-10 
15:09:54.000000000 +0000
@@ -52,6 +52,10 @@
     QWidget,
 )
 
+from mercurial import (
+    scmutil,
+)
+
 from ..util import hglib
 from ..util.i18n import _
 from . import (
@@ -366,7 +370,8 @@
         if ':' in link:
             scheme, param = link.split(':', 1)
             if scheme == 'cset':
-                rev = self.repo[hglib.fromunicode(param)].rev()
+                rev = scmutil.revsymbol(self.repo,
+                                        hglib.fromunicode(param)).rev()
                 return self.goto(rev)
         QDesktopServices.openUrl(QUrl(link))
 
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/fileview.py 
tortoisehg-4.8.1/tortoisehg/hgqt/fileview.py
--- tortoisehg-4.7/tortoisehg/hgqt/fileview.py  2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/fileview.py        2018-12-10 
15:09:54.000000000 +0000
@@ -1118,12 +1118,16 @@
         links = []
         fctxcache = {}  # (path, rev): fctx
         for l in data[0]['lines']:
-            path, rev = l['file'], l['rev']
+            try:
+                path, rev, lineno = l['path'], l['rev'], l['lineno']
+            except KeyError:
+                # hg<4.8 (34ba47117164, 47cb6750dea3)
+                path, rev, lineno = l['file'], l['rev'], l['line_number']
             try:
                 fctx = fctxcache[path, rev]
             except KeyError:
                 fctx = fctxcache[path, rev] = repo[rev][path]
-            links.append((fctx, l['line_number']))
+            links.append((fctx, lineno))
         self._links = links
         self._updateView()
 
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/graft.py 
tortoisehg-4.8.1/tortoisehg/hgqt/graft.py
--- tortoisehg-4.7/tortoisehg/hgqt/graft.py     2017-09-05 15:57:52.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/graft.py   2018-12-10 15:09:54.000000000 
+0000
@@ -24,6 +24,8 @@
     QVBoxLayout,
 )
 
+from mercurial import scmutil
+
 from ..util import hglib
 from ..util.i18n import _
 from . import (
@@ -53,7 +55,7 @@
         self.valid = True
 
         def cleanrevlist(revlist):
-            return [self.repo[rev].rev() for rev in revlist]
+            return [scmutil.revsymbol(self.repo, rev).rev() for rev in revlist]
         self.sourcelist = cleanrevlist(opts.get('source', ['.']))
         currgraftrevs = self.graftstate()
         if currgraftrevs:
@@ -220,17 +222,7 @@
         sess.commandFinished.connect(self._abortFinished)
 
     def graftstate(self):
-        graftstatefile = self.repo.vfs.join('graftstate')
-        if os.path.exists(graftstatefile):
-            f = open(graftstatefile, 'r')
-            info = f.readlines()
-            f.close()
-            if len(info):
-                revlist = [rev.strip() for rev in info]
-                revlist = [rev for rev in revlist if rev != '']
-                if revlist:
-                    return revlist
-        return None
+        return hglib.readgraftstate(self.repo)
 
     def _runCommand(self, cmdline):
         assert self._cmdsession.isFinished()
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/grep.py 
tortoisehg-4.8.1/tortoisehg/hgqt/grep.py
--- tortoisehg-4.7/tortoisehg/hgqt/grep.py      2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/grep.py    2018-12-10 15:09:54.000000000 
+0000
@@ -51,6 +51,7 @@
     match,
     subrepo,
     ui,
+    scmutil,
 )
 from mercurial.utils import (
     stringutil,
@@ -357,7 +358,7 @@
         if inc: inc = map(str.strip, inc.split(','))
         exc = hglib.fromunicode(self.excle.text())
         if exc: exc = map(str.strip, exc.split(','))
-        rev = hglib.fromunicode(self.revle.text()).strip()
+        revstr = hglib.fromunicode(self.revle.text()).strip()
 
         self.addHistory(pattern, inc or [], exc or [])
         if self.wctxradio.isChecked():
@@ -371,7 +372,8 @@
             self.tv.setColumnHidden(COL_REVISION, True)
             self.tv.setColumnHidden(COL_USER, True)
             try:
-                ctx = self.repo[rev or '.']
+                rev = scmutil.revsymbol(self.repo, revstr or '.').rev()
+                ctx = self.repo[rev]
             except error.RepoError, e:
                 msg = _('grep: %s\n') % hglib.tounicode(str(e))
                 self.showMessage.emit(msg)
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/hgemail_ui.py 
tortoisehg-4.8.1/tortoisehg/hgqt/hgemail_ui.py
--- tortoisehg-4.7/tortoisehg/hgqt/hgemail_ui.py        2018-04-07 
17:22:08.000000000 +0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/hgemail_ui.py      2018-11-28 
16:29:07.000000000 +0000
@@ -1,8 +1,8 @@
 # -*- coding: utf-8 -*-
 
-# Form implementation generated from reading ui file 
'/Users/sborho/repos/thg/tortoisehg/hgqt/hgemail.ui'
+# Form implementation generated from reading ui file 
'/home/sborho/repos/thg/tortoisehg/hgqt/hgemail.ui'
 #
-# Created by: PyQt5 UI code generator 5.10.1
+# Created by: PyQt5 UI code generator 5.11.2
 #
 # WARNING! All changes made in this file will be lost!
 
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/matching.py 
tortoisehg-4.8.1/tortoisehg/hgqt/matching.py
--- tortoisehg-4.7/tortoisehg/hgqt/matching.py  2017-09-05 15:57:52.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/matching.py        2018-12-10 
15:09:54.000000000 +0000
@@ -26,7 +26,10 @@
     QVBoxLayout,
 )
 
-from mercurial import error
+from mercurial import (
+    error,
+    scmutil,
+)
 
 from ..util import hglib
 from ..util.i18n import _
@@ -230,7 +233,7 @@
             self.match_btn.setEnabled(True)
             return
         try:
-            csinfo_update(self.repo[new_rev])
+            csinfo_update(scmutil.revsymbol(self.repo, new_rev))
             return
         except (error.LookupError, error.RepoLookupError, error.RepoError):
             pass
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/merge.py 
tortoisehg-4.8.1/tortoisehg/hgqt/merge.py
--- tortoisehg-4.7/tortoisehg/hgqt/merge.py     2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/merge.py   2018-12-10 15:09:54.000000000 
+0000
@@ -599,10 +599,13 @@
                 self.wizard().close()
             return True
 
-        user = hglib.tounicode(qtlib.getCurrentUsername(self, self.repo,
-                                                        self.opts))
-        if not user:
-            return False
+        # username will be prompted as necessary by hg if ui.askusername
+        user = self.opts.get('user')
+        if not self.repo.ui.configbool('ui', 'askusername'):
+            user = hglib.tounicode(qtlib.getCurrentUsername(self, self.repo,
+                                                            self.opts))
+            if not user:
+                return False
 
         self.setTitle(_('Committing...'))
         self.setSubTitle(_('Please wait while committing merged files.'))
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/mq.py 
tortoisehg-4.8.1/tortoisehg/hgqt/mq.py
--- tortoisehg-4.7/tortoisehg/hgqt/mq.py        2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/mq.py      2018-12-10 15:09:54.000000000 
+0000
@@ -45,7 +45,10 @@
     QWidget,
 )
 
-from mercurial import error
+from mercurial import (
+    error,
+    scmutil,
+)
 
 from ..util import hglib
 from ..util.i18n import _
@@ -522,7 +525,10 @@
         repo = self._repoagent.rawRepo()
         patch = self._series[index.row()]
         try:
-            ctx = repo[patch]
+            if patch in repo.thgmqunappliedpatches:
+                ctx = repo[patch]
+            else:
+                ctx = scmutil.revsymbol(repo, patch)
         except error.RepoLookupError:
             # cache not updated after qdelete or qfinish
             return
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/postreview_ui.py 
tortoisehg-4.8.1/tortoisehg/hgqt/postreview_ui.py
--- tortoisehg-4.7/tortoisehg/hgqt/postreview_ui.py     2018-04-07 
17:22:08.000000000 +0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/postreview_ui.py   2018-11-28 
16:29:07.000000000 +0000
@@ -1,8 +1,8 @@
 # -*- coding: utf-8 -*-
 
-# Form implementation generated from reading ui file 
'/Users/sborho/repos/thg/tortoisehg/hgqt/postreview.ui'
+# Form implementation generated from reading ui file 
'/home/sborho/repos/thg/tortoisehg/hgqt/postreview.ui'
 #
-# Created by: PyQt5 UI code generator 5.10.1
+# Created by: PyQt5 UI code generator 5.11.2
 #
 # WARNING! All changes made in this file will be lost!
 
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/qfold.py 
tortoisehg-4.8.1/tortoisehg/hgqt/qfold.py
--- tortoisehg-4.7/tortoisehg/hgqt/qfold.py     2018-04-29 04:23:40.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/qfold.py   2018-12-10 15:09:54.000000000 
+0000
@@ -28,6 +28,9 @@
 )
 
 from hgext import mq
+from mercurial import (
+    scmutil,
+)
 
 from ..util import hglib
 from ..util.i18n import _
@@ -135,9 +138,10 @@
         self.summ.setText(hglib.tounicode(txt))
 
     def composeMsg(self, patches):
-        return u'\n* * *\n'.join(
-              [hglib.tounicode(self.repo[p].description())
-               for p in ['qtip'] + patches])
+        descs = [scmutil.revsymbol(self.repo, 'qtip').description()]
+        # lookup of unapplied patches is handled by thgrepo hack
+        descs.extend(self.repo[p].description() for p in patches)
+        return u'\n* * *\n'.join(map(hglib.tounicode, descs))
 
     @pyqtSlot()
     def configChanged(self):
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/qscilib.py 
tortoisehg-4.8.1/tortoisehg/hgqt/qscilib.py
--- tortoisehg-4.7/tortoisehg/hgqt/qscilib.py   2018-06-22 17:00:33.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/qscilib.py 2018-12-10 15:09:54.000000000 
+0000
@@ -34,6 +34,7 @@
     QCheckBox,
     QDialog,
     QDialogButtonBox,
+    QFont,
     QInputMethodEvent,
     QKeyEvent,
     QKeySequence,
@@ -820,7 +821,12 @@
     editor.installEventFilter(KeyPressInterceptor(dialog))
     editor.setMarginLineNumbers(1, True)
     editor.setMarginWidth(1, '000')
-    editor.setLexer(QsciLexerProperties())
+
+    lexer = QsciLexerProperties()
+    lexer.setFont(QFont('Monospace', 10), -1)
+
+    editor.setLexer(lexer)
+
     if opts.get('foldable'):
         editor.setFolding(QsciScintilla.BoxedTreeFoldStyle)
     dialog.layout().addWidget(editor)
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/qtlib.py 
tortoisehg-4.8.1/tortoisehg/hgqt/qtlib.py
--- tortoisehg-4.7/tortoisehg/hgqt/qtlib.py     2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/qtlib.py   2018-12-10 15:09:54.000000000 
+0000
@@ -22,6 +22,7 @@
 import weakref
 
 from .qtcore import (
+    PYQT_VERSION,
     QByteArray,
     QDir,
     QEvent,
@@ -1470,5 +1471,5 @@
 def setContextMenuShortcut(action, shortcut):
     """Set shortcut for a context menu action, making sure it's visible"""
     action.setShortcut(shortcut)
-    if QT_VERSION >= 0x50a00:
+    if QT_VERSION >= 0x50a00 and PYQT_VERSION >= 0x50a00:
         action.setShortcutVisibleInContextMenu(True)
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/repofilter.py 
tortoisehg-4.8.1/tortoisehg/hgqt/repofilter.py
--- tortoisehg-4.7/tortoisehg/hgqt/repofilter.py        2018-04-29 
04:23:40.000000000 +0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/repofilter.py      2018-12-10 
15:09:54.000000000 +0000
@@ -35,6 +35,7 @@
 from mercurial import (
     error,
     repoview,
+    scmutil,
     util,
 )
 
@@ -60,6 +61,9 @@
 
 def _querytype(repo, query):
     r"""
+    >>> # TODO: maybe replace with real repo
+    >>> origisrevsymbol = scmutil.isrevsymbol
+    >>> scmutil.isrevsymbol = lambda repo, changeid: changeid in repo
     >>> repo = set('0 1 2 3 . stable'.split())
     >>> _querytype(repo, u'') is None
     True
@@ -79,6 +83,7 @@
     'revset'
     >>> _querytype(repo, u'\u3000')  # UnicodeEncodeError
     'revset'
+    >>> scmutil.isrevsymbol = origisrevsymbol
     """
     if not query:
         return
@@ -91,7 +96,7 @@
     if not changeid:
         return 'keyword'
     try:
-        if changeid in repo:
+        if scmutil.isrevsymbol(repo, changeid):
             return 'revset'
     except error.LookupError:  # ambiguous changeid
         pass
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/repoview.py 
tortoisehg-4.8.1/tortoisehg/hgqt/repoview.py
--- tortoisehg-4.7/tortoisehg/hgqt/repoview.py  2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/repoview.py        2018-12-10 
15:09:54.000000000 +0000
@@ -366,20 +366,23 @@
         """
         if isinstance(rev, unicode):
             rev = hglib.fromunicode(rev)
-        try:
-            rev = scmutil.revsymbol(self.repo, rev).rev()
-        except error.RepoError:
-            self.showMessage.emit(_("Can't find revision '%s'")
-                                  % hglib.tounicode(str(rev)))
-        except LookupError as e:
-            self.showMessage.emit(hglib.tounicode(str(e)))
-        else:
-            idx = self.model().indexFromRev(rev)
-            if idx.isValid():
-                flags = (QItemSelectionModel.ClearAndSelect
-                         | QItemSelectionModel.Rows)
-                self.selectionModel().setCurrentIndex(idx, flags)
-                self.scrollTo(idx)
+        if not isinstance(rev, int):
+            try:
+                rev = scmutil.revsymbol(self.repo, rev).rev()
+            except error.RepoError:
+                self.showMessage.emit(_("Can't find revision '%s'")
+                                      % hglib.tounicode(str(rev)))
+                return
+            except LookupError as e:
+                self.showMessage.emit(hglib.tounicode(str(e)))
+                return
+
+        idx = self.model().indexFromRev(rev)
+        if idx.isValid():
+            flags = (QItemSelectionModel.ClearAndSelect
+                     | QItemSelectionModel.Rows)
+            self.selectionModel().setCurrentIndex(idx, flags)
+            self.scrollTo(idx)
 
     def saveSettings(self, s = None):
         if not s:
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/repowidget.py 
tortoisehg-4.8.1/tortoisehg/hgqt/repowidget.py
--- tortoisehg-4.7/tortoisehg/hgqt/repowidget.py        2018-08-18 
20:51:20.000000000 +0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/repowidget.py      2018-12-10 
15:09:54.000000000 +0000
@@ -45,6 +45,7 @@
 from mercurial import (
     error,
     phases,
+    scmutil,
 )
 from mercurial.utils import (
     procutil,
@@ -637,7 +638,7 @@
         """Select and scroll to the specified revision"""
         try:
             # try instant look up
-            if hglib.fromunicode(revspec) in self.repo:
+            if scmutil.isrevsymbol(self.repo, hglib.fromunicode(revspec)):
                 self.repoview.goto(revspec)
                 return
         except error.LookupError:
@@ -1287,7 +1288,8 @@
 
         submenu = menu.addMenu(_('Change &Phase to'))
         submenu.triggered.connect(self._changePhaseByMenu)
-        for pnum, pname in enumerate(phases.phasenames):
+        # TODO: filter out hidden names better
+        for pnum, pname in enumerate(phases.phasenames[:3]):
             a = entry(items, submenu, None, enablefuncs['isrev'], pname)
             a.setData(pnum)
         entry(items, menu)
@@ -1411,9 +1413,9 @@
             dlg.restart(str(revB), str(revA))
         def compressDlg():
             ctxa, ctxb = map(self.repo.hgchangectx, self.menuselection)
-            if ctxa.ancestor(ctxb) == ctxb:
+            if ctxa.ancestor(ctxb).rev() == ctxb.rev():
                 revs = self.menuselection[:]
-            elif ctxa.ancestor(ctxb) == ctxa:
+            elif ctxa.ancestor(ctxb).rev() == ctxa.rev():
                 revs = [self.menuselection[1], self.menuselection[0]]
             else:
                 InfoMsgBox(_('Unable to compress history'),
@@ -1803,13 +1805,27 @@
 
     @pyqtSlot()
     def mergeWithRevision(self):
+        # Don't use self.rev (i.e. the current revision.) This is a context
+        # menu handler, and the menu is open for the selected rows, not for
+        # the current row.
+        revisions = self.repoview.selectedRevisions()
+        if len(revisions) != 1:
+            QMessageBox.warning(self, _('Unable to merge'),
+                                _('Please select a revision to merge.'))
+            return
+        rev = revisions[0]
+        if not isinstance(rev, int):
+            QMessageBox.warning(self, _('Unable to merge'),
+                                _('Cannot merge with a pseudo revision %r.')
+                                % rev)
+            return
         pctx = self.repo['.']
-        octx = self.repo[self.rev]
+        octx = self.repo[rev]
         if pctx == octx:
             QMessageBox.warning(self, _('Unable to merge'),
                 _('You cannot merge a revision with itself'))
             return
-        self._dialogs.open(RepoWidget._createMergeDialog, self.rev)
+        self._dialogs.open(RepoWidget._createMergeDialog, rev)
 
     def _createMergeDialog(self, rev):
         return merge.MergeDialog(self._repoagent, rev, self)
@@ -2035,7 +2051,7 @@
             QMessageBox.warning(self, _('Cannot import selected revision'),
                 _('The selected revision (rev #%d) cannot be imported '
                 'because it is not a descendant of ''qparent'' (rev #%d)') \
-                % (self.rev, self.repo['qparent'].rev()))
+                % (self.rev, scmutil.revsymbol(self.repo, 'qparent').rev()))
             return
 
         patchdir = self.repo.vfs.join('patches')
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/revpanel.py 
tortoisehg-4.8.1/tortoisehg/hgqt/revpanel.py
--- tortoisehg-4.7/tortoisehg/hgqt/revpanel.py  2018-04-29 04:23:40.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/revpanel.py        2018-12-10 
15:09:54.000000000 +0000
@@ -8,7 +8,10 @@
 
 from __future__ import absolute_import
 
-from mercurial import error
+from mercurial import (
+    error,
+    scmutil,
+)
 
 from ..util import hglib, obsoleteutil
 from ..util.i18n import _
@@ -81,7 +84,7 @@
         if not ts:
             return None
         try:
-            tctx = ctx._repo[ts]
+            tctx = scmutil.revsymbol(ctx.repo(), ts)
             return revline_data(tctx)
         except (error.LookupError, error.RepoLookupError, error.RepoError):
             return ts
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/run.py 
tortoisehg-4.8.1/tortoisehg/hgqt/run.py
--- tortoisehg-4.7/tortoisehg/hgqt/run.py       2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/run.py     2018-12-10 15:09:54.000000000 
+0000
@@ -227,7 +227,9 @@
         sys.exit()
     else:
         alias, args = 'workbench', []
-    aliases, i = cmdutil.findcmd(alias, table, ui.config("ui", "strict"))
+    # copies hg<4.8 (fa88170c10bb) behavior
+    stable = {k.lstrip('^'): e for k, e in table.items()}
+    aliases, i = cmdutil.findcmd(alias, stable, ui.config("ui", "strict"))
     for a in aliases:
         if a.startswith(alias):
             alias = a
@@ -732,8 +734,10 @@
             version(ui)
             ui.write('\n')
 
+        # copies hg<4.8 (fa88170c10bb) behavior
+        stable = {k.lstrip('^'): e for k, e in table.items()}
         try:
-            aliases, i = cmdutil.findcmd(name, table, False)
+            aliases, i = cmdutil.findcmd(name, stable, False)
         except error.AmbiguousCommand, inst:
             select = lambda c: c.lstrip('^').startswith(inst.args[0])
             helplist(_('list of commands:\n\n'), select)
@@ -771,6 +775,7 @@
             if (not select and name != 'shortlist' and
                 e[0].__module__ != __name__):
                 continue
+            # TODO: switch to hg>=4.8 (fa88170c10bb) syntax
             if name == "shortlist" and not f.startswith("^"):
                 continue
             f = f.lstrip("^")
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/rupdate.py 
tortoisehg-4.8.1/tortoisehg/hgqt/rupdate.py
--- tortoisehg-4.7/tortoisehg/hgqt/rupdate.py   2017-09-05 15:57:52.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/rupdate.py 2018-12-10 15:09:54.000000000 
+0000
@@ -34,7 +34,10 @@
     QVBoxLayout,
 )
 
-from mercurial import error
+from mercurial import (
+    error,
+    scmutil,
+)
 
 from ..util import hglib
 from ..util.i18n import _
@@ -145,7 +148,7 @@
             self.commandChanged.emit()
             return
         try:
-            self.target_info.update(self.repo[new_rev])
+            self.target_info.update(scmutil.revsymbol(self.repo, new_rev))
         except (error.LookupError, error.RepoLookupError, error.RepoError):
             self.target_info.setText(_('unknown revision!'))
         self.commandChanged.emit()
@@ -153,8 +156,8 @@
     def canRunCommand(self):
         rev = hglib.fromunicode(self.rev_combo.currentText())
         try:
-            return rev in self.repo
-        except error.LookupError:
+            return scmutil.isrevsymbol(self.repo, rev)
+        except error.AmbiguousPrefixLookupError:
             # ambiguous changeid
             return False
 
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/serve_ui.py 
tortoisehg-4.8.1/tortoisehg/hgqt/serve_ui.py
--- tortoisehg-4.7/tortoisehg/hgqt/serve_ui.py  2018-04-07 17:22:08.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/serve_ui.py        2018-11-28 
16:29:07.000000000 +0000
@@ -1,8 +1,8 @@
 # -*- coding: utf-8 -*-
 
-# Form implementation generated from reading ui file 
'/Users/sborho/repos/thg/tortoisehg/hgqt/serve.ui'
+# Form implementation generated from reading ui file 
'/home/sborho/repos/thg/tortoisehg/hgqt/serve.ui'
 #
-# Created by: PyQt5 UI code generator 5.10.1
+# Created by: PyQt5 UI code generator 5.11.2
 #
 # WARNING! All changes made in this file will be lost!
 
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/settings.py 
tortoisehg-4.8.1/tortoisehg/hgqt/settings.py
--- tortoisehg-4.7/tortoisehg/hgqt/settings.py  2018-01-16 02:24:53.000000000 
+0000
+++ tortoisehg-4.8.1/tortoisehg/hgqt/settings.py        2018-12-10 
15:09:54.000000000 +0000
@@ -694,6 +694,12 @@
         _('If specified, files in the directory, e.g. .hgignore, are copied '
           'to the newly-created repository.'),
         globalonly=True),
+    _fi(_('Default Clone Destination'), 'tortoisehg.defaultclonedest',
+        genPathBrowser,
+        _('If specified, the destination field in the clone widget will be '
+          'pre-filled with this path. Otherwise, it will be pre-filled with '
+          'the current working directory.'),
+        globalonly=True),
     )),
 
 ({'name': 'log', 'label': _('Workbench'), 'icon': 'hg-log'}, (
@@ -826,7 +832,7 @@
           'This setting is used by the Merge, Tag and Backout dialogs. '
           'Default: False')),
     _fi(_('New Commit Phase'), 'phases.new-commit',
-        (genDefaultCombo, phases.phasenames),
+        (genDefaultCombo, phases.phasenames[:3]),
         _('The phase of new commits. Default: draft')),
     _fi(_('Secret MQ Patches'), 'mq.secret', genBoolRBGroup,
         _('Make MQ patches secret (instead of draft). '
@@ -1155,7 +1161,8 @@
         )),
     )),
 
-({'name': 'reviewboard', 'label': _('Review Board'), 'icon': 'reviewboard'}, (
+({'name': 'reviewboard', 'label': _('Review Board'), 'icon': 'reviewboard',
+  'extension': 'reviewboard'}, (
     _fi(_('Server'), 'reviewboard.server', genEditCombo,
         _('Path to review board '
           'example "http://demo.reviewboard.org";')),
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/thgstrip.py 
tortoisehg-4.8.1/tortoisehg/hgqt/thgstrip.py
--- tortoisehg-4.7/tortoisehg/hgqt/thgstrip.py  2017-08-19 16:31:41.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/thgstrip.py        2018-12-10 
15:09:54.000000000 +0000
@@ -21,7 +21,10 @@
     QVBoxLayout,
 )
 
-from mercurial import error
+from mercurial import (
+    error,
+    scmutil,
+)
 
 from ..util import hglib
 from ..util.i18n import _, ngettext
@@ -114,7 +117,7 @@
         if not revstr:
             return None
         try:
-            rev = self.repo[revstr].rev()
+            rev = scmutil.revsymbol(self.repo, revstr).rev()
         except (error.RepoError, error.LookupError):
             return None
         return rev
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/update.py 
tortoisehg-4.8.1/tortoisehg/hgqt/update.py
--- tortoisehg-4.7/tortoisehg/hgqt/update.py    2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/update.py  2018-12-10 15:09:54.000000000 
+0000
@@ -180,7 +180,7 @@
         self.p1_info.update(self.ctxs[0].node())
         merge = len(self.ctxs) == 2
         if merge:
-            self.p2_info.update(self.ctxs[1])
+            self.p2_info.update(self.ctxs[1].node())
         new_rev = hglib.fromunicode(self.rev_combo.currentText())
         if new_rev == 'null':
             self.target_info.setText(_('remove working directory'))
@@ -324,7 +324,8 @@
                 if clean is None:
                     clean = isclean()
                 pa = p1.ancestor(p2)
-                return not clean and (p1 == pa or p2 == pa)
+                return not clean \
+                    and (p1.rev() == pa.rev() or p2.rev() == pa.rev())
             def confirmupdate(clean=None):
                 if clean is None:
                     clean = isclean()
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/visdiff.py 
tortoisehg-4.8.1/tortoisehg/hgqt/visdiff.py
--- tortoisehg-4.7/tortoisehg/hgqt/visdiff.py   2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/visdiff.py 2018-12-10 15:09:54.000000000 
+0000
@@ -213,7 +213,11 @@
     try:
         ctx1b = None
         if change:
-            ctx2 = repo[change]
+            # TODO: figure out what's the expect type
+            if isinstance(change,  str):
+                ctx2 = scmutil.revsymbol(repo, change)
+            else:
+                ctx2 = repo[change]
             p = ctx2.parents()
             if len(p) > 1:
                 ctx1a, ctx1b = p
diff -Nru tortoisehg-4.7/tortoisehg/hgqt/webconf_ui.py 
tortoisehg-4.8.1/tortoisehg/hgqt/webconf_ui.py
--- tortoisehg-4.7/tortoisehg/hgqt/webconf_ui.py        2018-04-07 
17:22:08.000000000 +0100
+++ tortoisehg-4.8.1/tortoisehg/hgqt/webconf_ui.py      2018-11-28 
16:29:07.000000000 +0000
@@ -1,8 +1,8 @@
 # -*- coding: utf-8 -*-
 
-# Form implementation generated from reading ui file 
'/Users/sborho/repos/thg/tortoisehg/hgqt/webconf.ui'
+# Form implementation generated from reading ui file 
'/home/sborho/repos/thg/tortoisehg/hgqt/webconf.ui'
 #
-# Created by: PyQt5 UI code generator 5.10.1
+# Created by: PyQt5 UI code generator 5.11.2
 #
 # WARNING! All changes made in this file will be lost!
 
diff -Nru tortoisehg-4.7/tortoisehg/util/__version__.py 
tortoisehg-4.8.1/tortoisehg/util/__version__.py
--- tortoisehg-4.7/tortoisehg/util/__version__.py       2018-08-20 
04:03:05.000000000 +0100
+++ tortoisehg-4.8.1/tortoisehg/util/__version__.py     2018-12-10 
15:09:59.000000000 +0000
@@ -1,2 +1,2 @@
 # this file is autogenerated by setup.py
-version = "4.7"
+version = "4.8.1"
diff -Nru tortoisehg-4.7/tortoisehg/util/hglib.py 
tortoisehg-4.8.1/tortoisehg/util/hglib.py
--- tortoisehg-4.7/tortoisehg/util/hglib.py     2018-08-18 20:51:20.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/util/hglib.py   2018-12-10 15:09:54.000000000 
+0000
@@ -32,6 +32,7 @@
     revset as revsetmod,
     revsetlang,
     scmutil,
+    state as statemod,
     subrepoutil,
     ui as uimod,
     util,
@@ -250,6 +251,22 @@
         qqueues = []
     return qqueues
 
+def readgraftstate(repo):
+    """Read a list of nodes from graftstate; or None if nothing in progress"""
+    graftstatefile = repo.vfs.join('graftstate')
+    if not os.path.exists(graftstatefile):
+        return
+    with open(graftstatefile, 'r') as f:
+        info = f.readlines()
+    if info and info[0] == '1\n':
+        # doesn't look like a list of nodes
+        return statemod.cmdstate(repo, 'graftstate').read()['nodes']
+    if len(info):
+        revlist = [rev.strip() for rev in info]
+        revlist = [rev for rev in revlist if rev != '']
+        if revlist:
+            return revlist
+
 readmergestate = mergemod.mergestate.read
 
 def readundodesc(repo):
@@ -290,11 +307,13 @@
     disabledexts = disabledextensions()
     exts = (disabledexts or {}).copy()
     exts.update(enabledexts)
+    exts.pop('configitems')   # tortoisehg.util.configitems
     if hasattr(sys, "frozen"):
         if 'hgsubversion' not in exts:
             exts['hgsubversion'] = _('hgsubversion packaged with thg')
         if 'hggit' not in exts:
             exts['hggit'] = _('hggit packaged with thg')
+        exts.pop('mercurial_extension_utils', None)  # Part of keyring 
extension
     return exts
 
 def validateextensions(enabledexts):
@@ -316,7 +335,7 @@
         exts['perfarce'] = _('perfarce is incompatible with hgsubversion')
     return exts
 
-def _loadextensionwithblacklist(orig, ui, name, path):
+def _loadextensionwithblacklist(orig, ui, name, path, *args, **kwargs):
     if name.startswith('hgext.') or name.startswith('hgext/'):
         shortname = name[6:]
     else:
@@ -324,7 +343,7 @@
     if shortname in _extensions_blacklist and not path:  # only bundled ext
         return
 
-    return orig(ui, name, path)
+    return orig(ui, name, path, *args, **kwargs)
 
 def _wrapextensionsloader():
     """Wrap extensions.load(ui, name) for blacklist to take effect"""
@@ -719,6 +738,16 @@
         user = ''
     return user
 
+def getestimatedsize(fctx):
+    """Return the size of the given fctx without loading the revision text"""
+    if fctx.rev() is None:
+        return fctx.size()
+    else:
+        # fctx.size() can read all data into memory in rename cases so
+        # we read the size directly from the filelog, this is deeper
+        # under the API than I prefer to go, but seems necessary
+        return fctx._filelog._revlog.rawsize(fctx.filerev())
+
 def get_revision_desc(fctx, curpath=None):
     """return the revision description as a string"""
     author = tounicode(username(fctx.user()))
diff -Nru tortoisehg-4.7/tortoisehg/util/hgversion.py 
tortoisehg-4.8.1/tortoisehg/util/hgversion.py
--- tortoisehg-4.7/tortoisehg/util/hgversion.py 2018-08-18 20:51:21.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/util/hgversion.py       2018-12-10 
15:09:54.000000000 +0000
@@ -16,7 +16,7 @@
     from mercurial import version
     hgversion = version.get_version()
 
-testedwith = '4.6 4.7'
+testedwith = '4.7 4.8'
 
 def checkhgversion(v):
     """range check the Mercurial version"""
diff -Nru tortoisehg-4.7/tortoisehg/util/patchctx.py 
tortoisehg-4.8.1/tortoisehg/util/patchctx.py
--- tortoisehg-4.7/tortoisehg/util/patchctx.py  2018-08-18 20:51:21.000000000 
+0100
+++ tortoisehg-4.8.1/tortoisehg/util/patchctx.py        2018-12-10 
15:09:54.000000000 +0000
@@ -110,6 +110,7 @@
     def description(self):  return self._desc
     def branch(self):       return self._branch
     def parents(self):      return ()
+    def repo(self):         return self._repo
     def tags(self):         return ()
     def bookmarks(self):    return ()
     def children(self):     return ()
diff -Nru tortoisehg-4.7/tortoisehg/util/version.py 
tortoisehg-4.8.1/tortoisehg/util/version.py
--- tortoisehg-4.7/tortoisehg/util/version.py   2016-02-24 16:23:43.000000000 
+0000
+++ tortoisehg-4.8.1/tortoisehg/util/version.py 2018-12-10 15:09:54.000000000 
+0000
@@ -56,25 +56,69 @@
 def package_version():
     try:
         branch, version = liveversion()
+        return _build_package_version(branch, version)
+    except:
+        pass
+    try:
+        import __version__
+        return _build_package_version('stable', __version__.version)
+    except ImportError:
+        return _('unknown')
 
-        extra = None
-        if '+' in version:
-            version, extra = version.split('+', 1)
+def _build_package_version(branch, version):
+    """
+    >>> _build_package_version('default', '4.8+10')
+    '4.8.5010'
+    >>> _build_package_version('stable', '4.8.2+5')
+    '4.8.21005'
+    >>> _build_package_version('stable', '4.8')
+    '4.8.0'
+    >>> _build_package_version('stable', '4.8.3')
+    '4.8.3'
+    >>> _build_package_version('stable', '4.8rc1')
+    '4.7.91000'
+    >>> _build_package_version('stable', '4.8rc1+2')
+    '4.7.91002'
+    >>> _build_package_version('stable', '1.0rc0')
+    '0.9.90000'
+    >>> _build_package_version('stable', '0.1rc0')
+    '0.0.90000'
+    """
+    extra = rc = None
+    if '+' in version:
+        version, extra = version.split('+', 1)
+    if 'rc' in version:
+        version, rc = version.split('rc', 1)
+        if extra is None:
+            extra = '0'  # rc should be a development release
 
-        v = [int(x) for x in version.split('.')]
-        while len(v) < 3:
-            v.append(0)
-        major, minor, periodic = v
+    v = [int(x) for x in version.split('.')]
+    if rc:
+        v = _decrement_version(v)
+    while len(v) < 3:
+        v.append(0)
+    major, minor, periodic = v
 
-        if extra != None:
-            tagdistance = int(extra.split('-', 1)[0])
-            periodic *= 10000
-            if branch == 'default':
-                periodic += tagdistance + 5000
-            else:
-                periodic += tagdistance + 1000
+    if extra != None:
+        tagdistance = int(extra.split('-', 1)[0])
+        periodic *= 10000
+        if rc:
+            periodic += tagdistance + int(rc) * 1000 + 90000
+        elif branch == 'default':
+            periodic += tagdistance + 5000
+        else:
+            periodic += tagdistance + 1000
 
-        return '.'.join([str(x) for x in (major, minor, periodic)])
-    except:
-        pass
-    return _('unknown')
+    return '.'.join([str(x) for x in (major, minor, periodic)])
+
+def _decrement_version(v):
+    if not v:
+        return v
+    v = v[:]
+    p = len(v) - 1
+    v[p] -= 1
+    while p > 0 and v[p] < 0:
+        v[p] = 9
+        v[p - 1] -= 1
+        p -= 1
+    return v
diff -Nru tortoisehg-4.7/debian/changelog tortoisehg-4.8.1/debian/changelog
--- tortoisehg-4.7/debian/changelog	2018-09-01 16:37:37.000000000 +0100
+++ tortoisehg-4.8.1/debian/changelog	2018-12-22 11:21:56.000000000 +0000
@@ -1,3 +1,21 @@
+tortoisehg (4.8.1-0.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+
+  [ James Cowgill ]
+  * New upstream version. (Closes: #909583)
+  * d/control:
+    - Update mercurial dependency to allow 4.7 and 4.8. (Closes: #914200)
+
+  [ Ondřej Nový ]
+  * d/control: Remove ancient X-Python-Version field.
+  * d/copyright: Use https protocol in Format field.
+
+  [ Stéphane Blondon ]
+  * d/thg.1.xml: Uudate link to upstream BTS in the manpage. (Closes: #915858)
+
+ -- James Cowgill <jcowg...@debian.org>  Sat, 22 Dec 2018 11:21:56 +0000
+
 tortoisehg (4.7-0.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru tortoisehg-4.7/debian/control tortoisehg-4.8.1/debian/control
--- tortoisehg-4.7/debian/control	2018-09-01 16:36:09.000000000 +0100
+++ tortoisehg-4.8.1/debian/control	2018-12-22 11:21:56.000000000 +0000
@@ -14,11 +14,10 @@
 Homepage: https://tortoisehg.bitbucket.io
 Vcs-Git: https://salsa.debian.org/debian/tortoisehg.git
 Vcs-Browser: https://salsa.debian.org/debian/tortoisehg
-X-Python-Version: >= 2.4
 
 Package: tortoisehg
 Architecture: all
-Depends: mercurial (>= 4.7~), mercurial (<< 4.8~), python-pyqt5,
+Depends: mercurial (>= 4.7~), mercurial (<< 4.9~), python-pyqt5,
  python-pyqt5.qsci, ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
 Recommends: libjs-jquery, libjs-underscore, python-iniparse, python-pygments
 Suggests: tortoisehg-nautilus
diff -Nru tortoisehg-4.7/debian/copyright tortoisehg-4.8.1/debian/copyright
--- tortoisehg-4.7/debian/copyright	2018-08-30 09:14:34.000000000 +0100
+++ tortoisehg-4.8.1/debian/copyright	2018-12-22 11:21:56.000000000 +0000
@@ -1,4 +1,4 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: TortoiseHg
 Upstream-Contact: Maintainer: Steve Borho <st...@borho.org>, TK Soh <teekay...@gmail.com>
 Source: https://tortoisehg.bitbucket.io/download/source.html
diff -Nru tortoisehg-4.7/debian/thg.1.xml tortoisehg-4.8.1/debian/thg.1.xml
--- tortoisehg-4.7/debian/thg.1.xml	2018-08-30 09:14:34.000000000 +0100
+++ tortoisehg-4.8.1/debian/thg.1.xml	2018-12-22 11:21:56.000000000 +0000
@@ -453,7 +453,7 @@
     <!-- Or use this section to tell about upstream BTS. -->
     <title>BUGS</title>
     <para>The upstreams <acronym>BTS</acronym> can be found
-      at <ulink url="http://bitbucket.org/tortoisehg/stable/issues/"/>.</para>
+      at <ulink url="https://bitbucket.org/tortoisehg/thg/issues"/>.</para>
   </refsect1>
   <refsect1 id="see_also">
     <title>SEE ALSO</title>

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to