Commits

André Sintzoff  committed 4f0fd2a

revset: display "fromsvn" and "svnrev" items 0 or 1 time

as a RevisionSetQuery dialog is created for each repository, use local
variables for "logical" and "ancestry" items as they have to be updated
according to hgsubversion extension status.

Previously, fromsvn and svnrev items could appear several times in the dialog
even hgsubversion extension was not enabled for a repository

  • Participants
  • Parent commits c7b7df9
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/revset.py

         layout.setContentsMargins(*(4,)*4)
         self.setLayout(layout)
 
+        logical = _logical
+        ancestry = _ancestry
+
         if 'hgsubversion' in repo.extensions():
-            global _logical, _ancestry
-            _logical = list(_logical) + [('fromsvn()',
+            logical = list(logical) + [('fromsvn()',
                     _('all revisions converted from subversion')),]
-            _ancestry = list(_ancestry) + [('svnrev(rev)',
+            ancestry = list(ancestry) + [('svnrev(rev)',
                     _('changeset which represents converted svn revision')),]
 
         self.stbar = cmdui.ThgStatusBar(self)
         def setAncHelp(row):
             self.stbar.showMessage(self.alw._help[row])
         self.alw = QListWidget(self)
-        self.alw.addItems([x for x, y in _ancestry])
-        self.alw._help = [y for x, y in _ancestry]
+        self.alw.addItems([x for x, y in ancestry])
+        self.alw._help = [y for x, y in ancestry]
         self.alw.currentRowChanged.connect(setAncHelp)
         agb.layout().addWidget(self.alw)
         hbox.addWidget(agb)
         def setManipHelp(row):
             self.stbar.showMessage(self.llw._help[row])
         self.llw = QListWidget(self)
-        self.llw.addItems([x for x, y in _logical])
-        self.llw._help = [y for x, y in _logical]
+        self.llw.addItems([x for x, y in logical])
+        self.llw._help = [y for x, y in logical]
         self.llw.currentRowChanged.connect(setManipHelp)
         lgb.layout().addWidget(self.llw)
         hbox.addWidget(lgb)
         layout.addLayout(hbox, 1)
 
         self.entry = RevsetEntry(self)
-        self.entry.addCompletions(_logical, _ancestry, _filepatterns, _common)
+        self.entry.addCompletions(logical, ancestry, _filepatterns, _common)
         layout.addWidget(self.entry, 0)
 
         txt = _('<a href="http://www.selenic.com/mercurial/hg.1.html#revsets">'