# HG changeset patch
# User Simon Heimberg <[email protected]>
# Date 1245669566 -7200
# Node ID 3e2e45402176eb061455179132ec2180bf464ed2
# Parent  efef6da0111c9de04884ba5ce9d0a9d6d55588fb
hgshelve/commit: let work with old hg

diff -r efef6da0111c -r 3e2e45402176 hggtk/commit.py
--- a/hggtk/commit.py   Son Jun 21 14:37:34 2009 +0200
+++ b/hggtk/commit.py   Mon Jun 22 13:19:26 2009 +0200
@@ -461,8 +461,13 @@
             if dopatch:
                 try:
                     pfiles = {}
-                    patch.internalpatch(fp, ui, 1, repo.root, files=pfiles,
+                    if patch.patchfile.__bases__:
+                        # Mercurial 1.3
+                        patch.internalpatch(fp, ui, 1, repo.root, files=pfiles,
                                         eolmode=None)
+                    else:
+                        # Mercurial 1.2
+                        patch.internalpatch(fp, ui, 1, repo.root, files=pfiles)
                     patch.updatedir(ui, repo, pfiles)
                 except patch.PatchError, err:
                     s = str(err)
diff -r efef6da0111c -r 3e2e45402176 hggtk/hgshelve.py
--- a/hggtk/hgshelve.py Son Jun 21 14:37:34 2009 +0200
+++ b/hggtk/hgshelve.py Mon Jun 22 13:19:26 2009 +0200
@@ -501,7 +501,7 @@
                 if dopatch:
                     ui.debug(_('applying patch\n'))
                     ui.debug(fp.getvalue())
-                    if hasattr(patch, 'linereader'):
+                    if patch.patchfile.__bases__:
                         # Mercurial 1.3
                         patch.internalpatch(fp, ui, 1, repo.root, eolmode=None)
                     else:

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to