changeset 13:88da4618d578

added better reporting for case where patch is empty; it's now treated as an error.
author Atul Varma <avarma@mozilla.com>
date Thu, 03 Jun 2010 09:41:11 -0700
parents 6de4d72474b9
children 4ba34e1cf310
files bzezpatch/app.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bzezpatch/app.py	Thu Jun 03 09:33:55 2010 -0700
+++ b/bzezpatch/app.py	Thu Jun 03 09:41:11 2010 -0700
@@ -68,8 +68,13 @@
             try:
                 patch = self.hg.trypatch(url, out=tmplog)
                 tmplog.seek(0)
-                info = {'success': True, 'patch': patch,
-                        'log': tmplog.read()}
+                log = tmplog.read()
+                if patch:
+                    info = {'success': True, 'patch': patch, 'log': log}
+                else:
+                    log += ('\nThere is no difference between your repo '
+                            'and the latest canonical repo.')
+                    info = {'success': False, 'log': log}
             except Exception, e:
                 print traceback.format_exc()
                 tmplog.seek(0)