Commits

Yuya Nishihara committed 317395c

repowidget: clear bundle even if all revisions aren't pulled (fixes #2580)

Before 54e0729935e5, ConfirmInfoBar had a bug to emit rejected followed by
accepted. Because of it, rejectBundle() was called before onPullCompleted(),
so the incoming preview was always cleared.

click "Accept" -> confirm.accepted -> pullBundle -> syncStarted
-> clearInfoBar -> confirm.close -> confirm.rejected -> rejectBundle
(bug: confirm infobar should be closed already)

When onPullCompleted() was implemented, 37bce9d5ea7e, RepoWidget had buttons
to accept/reject the bundle, so it can restart pullBundle after failure.
But now, CommandErrorInfoBar has no GUI to try pullBundle again, so this patch
changes onPullCompleted() to just clear the bundle.

  • Participants
  • Parent commits a4d8540
  • Branches stable
  • Tags 2.8

Comments (0)

Files changed (1)

tortoisehg/hgqt/repowidget.py

 
     def onPullCompleted(self):
         if self.bundle:
-            # create a new bundlerepo instance; revision numbers may change
-            brepo = thgrepo.repository(self.repo.ui, self.repo.root,
-                                       bundle=self.bundle)
-            repo = thgrepo.repository(self.repo.ui, self.repo.root)
-            if len(repo) == len(brepo):
-                # all bundle revisions pulled
-                self.clearBundle()
-                self.reload(invalidate=False)
-            else:
-                # refresh revset with remaining revisions
-                self.revset = range(len(repo), len(brepo))
-                self.repo = brepo
-                self.repoview.setRepo(brepo)
-                self.revDetailsWidget.setRepo(brepo)
-                self.manifestDemand.forward('setRepo', brepo)
-                self.reload(invalidate=False)
-                self.repomodel.revset = self.revset
-                self.repoview.resetBrowseHistory(self.revset)
-                self._reload_rev = self.revset[0]
+            self.clearBundle()
+            self.reload(invalidate=False)
 
     def acceptBundle(self):
         if self.bundle: