Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py

changeset 203
0bd3912f3c5f
parent 181
4af57f97c1bc
child 204
61552f56788a
equal deleted inserted replaced
202:6854bb0beda5 203:0bd3912f3c5f
110 self.vcs.addArguments(args, self.vcs.options['global']) 110 self.vcs.addArguments(args, self.vcs.options['global'])
111 self.vcs.addArguments(args, self.vcs.options['log']) 111 self.vcs.addArguments(args, self.vcs.options['log'])
112 if noEntries: 112 if noEntries:
113 args.append('--limit') 113 args.append('--limit')
114 args.append(str(noEntries)) 114 args.append(str(noEntries))
115 args.append('--template') 115 args.append('--copies')
116 args.append("change|{rev}:{node|short}\n" 116 args.append('--style')
117 "branches|{branches}\n" 117 args.append(os.path.join(os.path.dirname(__file__), "styles", "logDialog.style"))
118 "tags|{tags}\n"
119 "parents|{parents}\n"
120 "user|{author}\n"
121 "date|{date|isodate}\n"
122 "description|{desc}\n"
123 "file_adds|{file_adds}\n"
124 "files_mods|{file_mods}\n"
125 "file_dels|{file_dels}\n"
126 "@@@\n")
127 if self.fname != "." or self.dname != repodir: 118 if self.fname != "." or self.dname != repodir:
128 args.append(self.filename) 119 args.append(self.filename)
129 120
130 self.process.setWorkingDirectory(repodir) 121 self.process.setWorkingDirectory(repodir)
131 122
158 self.errorGroup.show() 149 self.errorGroup.show()
159 return 150 return
160 151
161 hasInitialText = 0 # three states flag (-1, 0, 1) 152 hasInitialText = 0 # three states flag (-1, 0, 1)
162 lvers = 1 153 lvers = 1
154 fileCopies = {}
163 for s in self.buf: 155 for s in self.buf:
164 if s == "@@@\n": 156 if s == "@@@\n":
165 self.contents.insertHtml('</p>{0}<br/>\n'.format(80 * "=")) 157 self.contents.insertHtml('</p>{0}<br/>\n'.format(80 * "="))
158 fileCopies = {}
166 else: 159 else:
167 try: 160 try:
168 key, value = s.split("|", 1) 161 key, value = s.split("|", 1)
169 except ValueError: 162 except ValueError:
170 key = "" 163 key = ""
214 self.trUtf8('<i>Date: {0}, {1}</i><br />\n')\ 207 self.trUtf8('<i>Date: {0}, {1}</i><br />\n')\
215 .format(date, time)) 208 .format(date, time))
216 elif key == "description": 209 elif key == "description":
217 self.contents.insertHtml(Utilities.html_encode(value.strip())) 210 self.contents.insertHtml(Utilities.html_encode(value.strip()))
218 self.contents.insertHtml('<br />\n') 211 self.contents.insertHtml('<br />\n')
212 elif key == "file_copies":
213 if value.strip():
214 for entry in value.strip().split(", "):
215 newName, oldName = entry[:-1].split(" (")
216 fileCopies[newName] = oldName
219 elif key == "file_adds": 217 elif key == "file_adds":
220 if value.strip(): 218 if value.strip():
221 self.contents.insertHtml('<br />\n') 219 self.contents.insertHtml('<br />\n')
222 for f in value.strip().split(): 220 for f in value.strip().split(", "):
223 self.contents.insertHtml( 221 if f in fileCopies:
224 self.trUtf8('Added {0}<br />\n')\ 222 self.contents.insertHtml(
225 .format(Utilities.html_encode(f))) 223 self.trUtf8('Added {0} (copied from {1})<br />\n')\
224 .format(Utilities.html_encode(f),
225 Utilities.html_encode(fileCopies[f])))
226 else:
227 self.contents.insertHtml(
228 self.trUtf8('Added {0}<br />\n')\
229 .format(Utilities.html_encode(f)))
226 elif key == "files_mods": 230 elif key == "files_mods":
227 if value.strip(): 231 if value.strip():
228 self.contents.insertHtml('<br />\n') 232 self.contents.insertHtml('<br />\n')
229 for f in value.strip().split(): 233 for f in value.strip().split(", "):
230 self.contents.insertHtml( 234 self.contents.insertHtml(
231 self.trUtf8('Modified {0}<br />\n')\ 235 self.trUtf8('Modified {0}<br />\n')\
232 .format(Utilities.html_encode(f))) 236 .format(Utilities.html_encode(f)))
233 elif key == "file_dels": 237 elif key == "file_dels":
234 if value.strip(): 238 if value.strip():
235 self.contents.insertHtml('<br />\n') 239 self.contents.insertHtml('<br />\n')
236 for f in value.strip().split(): 240 for f in value.strip().split(", "):
237 self.contents.insertHtml( 241 self.contents.insertHtml(
238 self.trUtf8('Deleted {0}<br />\n')\ 242 self.trUtf8('Deleted {0}<br />\n')\
239 .format(Utilities.html_encode(f))) 243 .format(Utilities.html_encode(f)))
240 else: 244 else:
241 if value.strip(): 245 if value.strip():

eric ide

mercurial