Continued with Mercurial bookmark support.

Sun, 08 May 2011 13:56:12 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 08 May 2011 13:56:12 +0200
changeset 1019
d8a9697f78d1
parent 1018
949812411ab8
child 1020
adf7e95f05e7

Continued with Mercurial bookmark support.

Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/styles/logBrowserBookmark.style file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/styles/logDialogBookmark.style file | annotate | diff | comparison | revisions
eric5.e4p file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat May 07 20:31:28 2011 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sun May 08 13:56:12 2011 +0200
@@ -766,7 +766,7 @@
                 elif key == "tags":
                     log["tags"] = value.strip().split(", ")
                 elif key == "bookmarks":
-                    log["bookmarks"] = value.strip().split()
+                    log["bookmarks"] = value.strip().split(", ")
                 else:
                     if initialText:
                         continue
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py	Sat May 07 20:31:28 2011 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py	Sun May 08 13:56:12 2011 +0200
@@ -127,7 +127,12 @@
         if self.mode == "log":
             args.append('--copies')
         args.append('--style')
-        args.append(os.path.join(os.path.dirname(__file__), "styles", "logDialog.style"))
+        if self.vcs.versionStr >= "1.8":
+            args.append(os.path.join(os.path.dirname(__file__),
+                                     "styles", "logDialogBookmark.style"))
+        else:
+            args.append(os.path.join(os.path.dirname(__file__),
+                                     "styles", "logDialog.style"))
         if self.mode == "incoming":
             if self.bundle:
                 args.append(self.bundle)
@@ -262,6 +267,9 @@
             
             html += self.trUtf8("Tags: {0}<br />\n").format(entry["tags"])
             
+            if "bookmarks" in entry:
+                html += self.trUtf8("Bookmarks: {0}<br />\n").format(entry["bookmarks"])
+            
             html += self.trUtf8("Parents: {0}<br />\n").format(entry["parents"])
             
             html += self.trUtf8('<i>Author: {0}</i><br />\n').format(entry["user"])
@@ -331,7 +339,7 @@
                     self.endInitialText = True
                 if key in ("change", "branches", "tags", "parents", "user",
                             "date", "file_copies", "file_adds", "files_mods",
-                            "file_dels"):
+                            "file_dels", "bookmarks"):
                     self.lastLogEntry[key] = value.strip()
                 elif key == "description":
                     self.lastLogEntry[key] = [value.strip()]
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Sat May 07 20:31:28 2011 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun May 08 13:56:12 2011 +0200
@@ -1058,7 +1058,7 @@
         args.append('parents')
         args.append('--template')
         args.append('{rev}:{node|short}@@@{tags}@@@{author|xmlescape}@@@'
-                    '{date|isodate}@@@{branches}\n')
+                    '{date|isodate}@@@{branches}@@@{bookmarks}\n')
         process.setWorkingDirectory(ppath)
         process.start('hg', args)
         procStarted = process.waitForStarted()
@@ -1070,7 +1070,7 @@
                 index = 0
                 for line in output.splitlines():
                     index += 1
-                    changeset, tags, author, date, branches = line.split("@@@")
+                    changeset, tags, author, date, branches, bookmarks = line.split("@@@")
                     cdate, ctime = date.split()[:2]
                     info.append("""<p><table>""")
                     info.append(QApplication.translate("mercurial",
@@ -1081,6 +1081,10 @@
                         info.append(QApplication.translate("mercurial",
                             """<tr><td><b>Tags</b></td><td>{0}</td></tr>""")\
                             .format('<br/>'.join(tags.split())))
+                    if bookmarks:
+                        info.append(QApplication.translate("mercurial",
+                            """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""")\
+                            .format('<br/>'.join(bookmarks.split())))
                     if branches:
                         info.append(QApplication.translate("mercurial",
                             """<tr><td><b>Branches</b></td><td>{0}</td></tr>""")\
@@ -1509,7 +1513,7 @@
         args.append(mode)
         args.append('--template')
         args.append('{rev}:{node|short}@@@{tags}@@@{author|xmlescape}@@@'
-                    '{date|isodate}@@@{branches}@@@{parents}\n')
+                    '{date|isodate}@@@{branches}@@@{parents}@@@{bookmarks}\n')
         
         process.setWorkingDirectory(repodir)
         process.start('hg', args)
@@ -1522,7 +1526,8 @@
                 index = 0
                 for line in output.splitlines():
                     index += 1
-                    changeset, tags, author, date, branches, parents = line.split("@@@")
+                    changeset, tags, author, date, branches, parents, bookmarks = \
+                        line.split("@@@")
                     cdate, ctime = date.split()[:2]
                     info.append("""<p><table>""")
                     if mode == "heads":
@@ -1543,6 +1548,10 @@
                         info.append(QApplication.translate("mercurial",
                             """<tr><td><b>Tags</b></td><td>{0}</td></tr>""")\
                             .format('<br/>'.join(tags.split())))
+                    if bookmarks:
+                        info.append(QApplication.translate("mercurial",
+                            """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""")\
+                            .format('<br/>'.join(bookmarks.split())))
                     if branches:
                         info.append(QApplication.translate("mercurial",
                             """<tr><td><b>Branches</b></td><td>{0}</td></tr>""")\
--- a/Plugins/VcsPlugins/vcsMercurial/styles/logBrowserBookmark.style	Sat May 07 20:31:28 2011 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/styles/logBrowserBookmark.style	Sun May 08 13:56:12 2011 +0200
@@ -11,3 +11,5 @@
 last_tag = '{tag}'
 branch = '{branch}, '
 last_branch = '{branch}'
+bookmark = '{bookmark}, '
+last_bookmark = '{bookmark}'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugins/VcsPlugins/vcsMercurial/styles/logDialogBookmark.style	Sun May 08 13:56:12 2011 +0200
@@ -0,0 +1,15 @@
+changeset = 'change|{rev}:{node|short}\nbranches|{branches}\ntags|{tags}\nparents|{parents}\nuser|{author}\ndate|{date|isodate}\ndescription|{desc}\nfile_copies|{file_copies}\nfile_adds|{file_adds}\nfiles_mods|{file_mods}\nfile_dels|{file_dels}\nbookmarks|{bookmarks}\n@@@\n'
+file_mod = '{file_mod}, '
+last_file_mod = '{file_mod}'
+file_add = '{file_add}, '
+last_file_add = '{file_add}'
+file_del = '{file_del}, '
+last_file_del = '{file_del}'
+file_copy = '{name} ({source}), '
+last_file_copy = '{name} ({source})'
+tag = '{tag}, '
+last_tag = '{tag}'
+branch = '{branch}, '
+last_branch = '{branch}'
+bookmark = '{bookmark}, '
+last_bookmark = '{bookmark}'
--- a/eric5.e4p	Sat May 07 20:31:28 2011 +0200
+++ b/eric5.e4p	Sun May 08 13:56:12 2011 +0200
@@ -1218,6 +1218,7 @@
     <Other>CSSs/blue.css</Other>
     <Other>CSSs/default.css</Other>
     <Other>Plugins/VcsPlugins/vcsMercurial/styles/logBrowserBookmark.style</Other>
+    <Other>Plugins/VcsPlugins/vcsMercurial/styles/logDialogBookmark.style</Other>
   </Others>
   <MainScript>eric5.py</MainScript>
   <Vcs>

eric ide

mercurial