1. Marc Schlaich
  2. thg-mac

Commits

Angel Ezquerra  committed 15b5adf

fileview: show proper message when subrepo is not missing but is invalid or missing revisions

This is a port to stable of 02f28fc92a81cd983f5f002c0f9f25a4c7e491b2, whose
description was as follows:

If a subrepo is missing, updating to a revision may create an "empty" subrepo
with no revisions. In those cases the message shown on the revision history was
wrong.

  • Participants
  • Parent commits 58fd62a
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/fileview.py

View file
  • Ignore whitespace
                     opts = {'date':None, 'user':None, 'rev':[sfrom]}
                     subabspath = os.path.join(repo.root, subrelpath)
                     missingsub = not os.path.isdir(subabspath)
+                    incompletesub = False
                     sfromlog = ''
                     def isinitialrevision(rev):
                         return all([el == '0' for el in rev])
                             _ui.pushbuffer()
                             commands.log(_ui, srepo, **opts)
                             sfromlog = hglib.tounicode(_ui.popbuffer())
-                        if sfromlog:
-                            sfromlog = _('From:') + u'\n' + sfromlog
+                            if not sfromlog:
+                                incompletesub = True
+                                sfromlog = _('changeset: %s') % sfrom + u'\n\n'
+                        sfromlog = _('From:') + u'\n' + sfromlog
 
                     if missingsub:
                         stolog = _('changeset: %s') % sto + '\n\n'
-                        sfromlog += _('Subrepository not found in working directory.') + '\n'
-                        sfromlog += _('Further subrepository revision information cannot be retrieved.') + '\n'
+                        sfromlog += _('Subrepository not found in the working '
+                            'directory.') + '\n'
+                        sfromlog += _('Further subrepository revision '
+                            'information cannot be retrieved.') + '\n'
+                    elif incompletesub:
+                        stolog = _('changeset: %s') % sto + '\n\n'
+                        sfromlog += _('Subrepository is either damaged or '
+                            'missing some revisions') + '\n'
+                        sfromlog += _('Further subrepository revision '
+                            'information cannot be retrieved.') + '\n'
+                        sfromlog += _('You may need to open the missing'
+                            'subrepository and \n'
+                            'manually pull the missing revisions from its '
+                            'source repository.') + '\n'
                     else:
                         opts['rev'] = [sto]
                         _ui.pushbuffer()