Commits

Jussi Hagman committed 8c51f55

XML workaround broke under 1.5. another workaround, should work with both 1.4 and 1.5.

  • Participants
  • Parent commits 18775b2

Comments (0)

Files changed (1)

File Source/HgLogOperation.m

 
 
 - (BOOL) _parseFullXML
-{
-    // workaround for xml.style not emitting its footer:
-    NSMutableData *xmlData = [self.outputData mutableCopy];
-    [xmlData appendData: [@"</repository>" dataUsingEncoding: NSUTF8StringEncoding]];
-        
+{        
+	NSXMLDocument *xml;
     // Parse XML output:
+	// Assume 1.5 and working xml output
     NSError *error = nil;
-    NSXMLDocument *xml = [[NSXMLDocument alloc] initWithData: xmlData
+    xml = [[NSXMLDocument alloc] initWithData: self.outputData
                                                      options: 0
-                                                       error: &error];
-    if( ! xml ) {
-        [xmlData writeToFile: @"/tmp/Murky.out" options: 0 error: nil];
-        return [self makeError: @"HgLogOperation couldn't parse XML: %@",error];
+													   error: &error];
+	
+    if( ! xml ) {		
+		// workaround for xml.style not emitting its footer:
+		NSMutableData *xmlData = [self.outputData mutableCopy];
+		[xmlData appendData: [@"</repository>" dataUsingEncoding: NSUTF8StringEncoding]];
+
+		NSXMLDocument *xml = [[NSXMLDocument alloc] initWithData: self.outputData
+														 options: 0
+														   error: &error];
+		
+		if ( ! xml) {
+			[xmlData writeToFile: @"/tmp/Murky.out" options: 0 error: nil];
+			return [self makeError: @"HgLogOperation couldn't parse XML: %@",error];
+		}
     }
     NSXMLElement *root = xml.rootElement;