Fredrik Ehnbom  committed 659e9c0

Fixed the Log All and Log Current File commands

  • Participants
  • Parent commits 2bb2eca
  • Branches default

Comments (0)

Files changed (1)

 import os
+import re
 import sys
 import sublime
 import sublime_plugin
 class HgLogCommand(HgCommand):
     def run(self, edit):
-        # the ASCII bell (\a) is just a convenient character I'm pretty sure won't ever come
-        # up in the subject of the commit (and if it does then you positively deserve broken
-        # output...)
-        # 9000 is a pretty arbitrarily chosen limit; picked entirely because it's about the size
-        # of the largest repo I've tested this on... and there's a definite hiccup when it's
-        # loading that
         self.run_command([get_hg(self.view), 'log', '-v','--', self.get_file_name()], self.log_done)
     def log_done(self, result):
-        self.results = [r.split('\a', 2) for r in result.strip().split('\n')]
+        self.results = [r.strip().split("\n") for r in result.strip().split('\n\n')]
         self.view.window().show_quick_panel(self.results, self.panel_done)
     def panel_done(self, picked):
         if 0 > picked > len(self.results):
         item = self.results[picked]
-        # the commit hash is the first thing on the second line
-        ref = item[1].split(' ')[0]
+        ref ="\w\d+(?=:)", item[0]).group(0)
         # I'm not certain I should have the file name here; it restricts the details to just
         # the current file. Depends on what the user expects... which I'm not sure of.
-        self.run_command([get_hg(self.view), 'log', '-p', '-1', ref, '--', self.get_file_name()], self.details_done)
+        self.run_command([get_hg(self.view), 'log', '-v', '-p', '-r', ref, '--', self.get_file_name()], self.details_done)
     def details_done(self, result):
         self.scratch(result, title = "Hg Commit Details")