Commits

Nicholas Riley  committed 8fe06a3

Newer versions of Mercurial no longer require the workaround for xml.style not emitting its footer.

  • Participants
  • Parent commits 4cf0832

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