Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.1, 1.1.1, and 1.1.2

Merge with stable

Changeset bcd9246d3995

Parents 0049c1c2fb91

Parents 56b42d08d603

by Steve Borho

Changes to one file · Browse files at bcd9246d3995 Showing diff from parent 0049c1c2fb91 56b42d08d603 Diff from another changeset...

 
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
 
 
 
 
 
 
 
 
 
 
 
1059
1060
1061
 
1119
1120
1121
 
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
 
 
 
 
 
 
 
 
 
 
 
 
1135
1136
1137
1138
 
 
 
 
 
 
1139
1140
1141
 
1175
1176
1177
1178
1179
1180
 
 
 
 
 
 
1181
1182
1183
 
1048
1049
1050
 
 
 
 
 
 
 
 
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
 
1122
1123
1124
1125
1126
1127
1128
 
 
 
 
 
 
 
 
 
 
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
 
 
 
1142
1143
1144
1145
1146
1147
1148
1149
1150
 
1184
1185
1186
 
 
 
1187
1188
1189
1190
1191
1192
1193
1194
1195
@@ -1048,14 +1048,17 @@
  opts.git = True   wctx = self.repo[None]   pctx1, pctx2 = wctx.parents() - difftext = [_('===== Diff to first parent %d:%s =====\n') % ( - pctx1.rev(), str(pctx1))] - for s in patch.diff(self.repo, pctx1.node(), None, opts=opts): - difftext.extend(s.splitlines(True)) - difftext.append(_('\n===== Diff to second parent %d:%s =====\n') % ( - pctx2.rev(), str(pctx2))) - for s in patch.diff(self.repo, pctx2.node(), None, opts=opts): - difftext.extend(s.splitlines(True)) + header = _('===== Diff to %s parent %d:%s =====\n') + difftext = [header % (_('first'), pctx1.rev(), str(pctx1))] + try: + for s in patch.diff(self.repo, pctx1.node(), None, opts=opts): + difftext.extend(s.splitlines(True)) + difftext.append('\n') + difftext.append(header % (_('second'), pctx2.rev(), str(pctx2))) + for s in patch.diff(self.repo, pctx2.node(), None, opts=opts): + difftext.extend(s.splitlines(True)) + except (IOError, error.RepoError, error.LookupError, util.Abort), e: + self.stbar.set_text(str(e))   else:   buf = cStringIO.StringIO()   for row in self.filemodel: @@ -1119,23 +1122,29 @@
  opts = patch.diffopts(self.ui, self.opts)   opts.git = True   difftext = [] + header = _('===== Diff to %s parent %d:%s =====\n')   if self.is_merge():   wctx = self.repo[None]   pctx1, pctx2 = wctx.parents() - difftext = [_('===== Diff to first parent %d:%s =====\n') % ( - pctx1.rev(), str(pctx1))] - for s in patch.diff(self.repo, pctx1.node(), None, - match=matcher, opts=opts): - difftext.extend(s.splitlines(True)) - difftext.append(_('\n===== Diff to second parent %d:%s =====\n') % ( - pctx2.rev(), str(pctx2))) - for s in patch.diff(self.repo, pctx2.node(), None, - match=matcher, opts=opts): - difftext.extend(s.splitlines(True)) + difftext = [header % (_('first'), pctx1.rev(), str(pctx1))] + try: + for s in patch.diff(self.repo, pctx1.node(), None, + match=matcher, opts=opts): + difftext.extend(s.splitlines(True)) + difftext.append('\n') + difftext.append(header % (_('second'), pctx2.rev(), str(pctx2))) + for s in patch.diff(self.repo, pctx2.node(), None, + match=matcher, opts=opts): + difftext.extend(s.splitlines(True)) + except (IOError, error.RepoError, error.LookupError, util.Abort), e: + self.stbar.set_text(str(e))   else: - for s in patch.diff(self.repo, self._node1, self._node2, - match=matcher, opts=opts): - difftext.extend(s.splitlines(True)) + try: + for s in patch.diff(self.repo, self._node1, self._node2, + match=matcher, opts=opts): + difftext.extend(s.splitlines(True)) + except (IOError, error.RepoError, error.LookupError, util.Abort), e: + self.stbar.set_text(str(e))   return self.diff_highlight_buffer(difftext)     @@ -1175,9 +1184,12 @@
  else:   matcher = cmdutil.matchfiles(self.repo, [pfile])   diffopts = mdiff.diffopts(git=True, nodates=True) - for s in patch.diff(self.repo, self._node1, self._node2, - match=matcher, opts=diffopts): - difftext.writelines(s.splitlines(True)) + try: + for s in patch.diff(self.repo, self._node1, self._node2, + match=matcher, opts=diffopts): + difftext.writelines(s.splitlines(True)) + except (IOError, error.RepoError, error.LookupError, util.Abort), e: + self.stbar.set_text(str(e))   difftext.seek(0)   return hgshelve.parsepatch(difftext)