Anonymous avatar Anonymous committed 25a8cbc

Change.get_description() returns something more similar to diff

Comments (0)

Files changed (1)

rope/base/change.py

     def get_description(self):
         result = [str(self) + ':\n\n\n']
         for change in self.changes:
-            result.append((' %s ' % str(change)).center(78, '=') + '\n')
             result.append(change.get_description())
+            result.append('\n')
         return ''.join(result)
 
     def __str__(self):
             self.old_contents.splitlines(True),
             self.new_contents.splitlines(True),
             'a/' + self.resource.path, 'b/' + self.resource.path)
-        return ''.join(list(result)[2:])
+        return ''.join(list(result))
 
     def get_changed_resources(self):
         return [self.resource]
         return 'Move <%s>' % self.old_resource.path
 
     def get_description(self):
-        return 'Move <%s> to <%s>' % (self.old_resource.path,
-                                      self.new_resource.path)
+        return 'rename from %s\nrename to %s' % (self.old_resource.path,
+                                                 self.new_resource.path)
 
     def get_changed_resources(self):
         return [self.old_resource, self.new_resource]
     def __str__(self):
         return 'Create Resource <%s>' % (self.resource.path)
 
+    def get_description(self):
+        return 'new file %s' % (self.resource.path)
+
     def get_changed_resources(self):
         return [self.resource]
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.