Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

thgrepo, commit: add workingBranchChanged signal to thgrepo

Now if you change branch names on the working dir (from the command line or
another tool, any open commit tool will automatically find out.

Changeset 6eff4bc11426

Parent 07791f77d4f0

by Steve Borho

Changes to 2 files · Browse files at 6eff4bc11426 Showing diff from parent 07791f77d4f0 Diff from another changeset...

 
53
54
55
 
56
57
58
 
131
132
133
 
 
 
 
134
135
136
 
146
147
148
149
150
151
152
153
 
162
163
164
165
 
166
167
168
 
53
54
55
56
57
58
59
 
132
133
134
135
136
137
138
139
140
141
 
151
152
153
 
 
154
155
156
 
165
166
167
 
168
169
170
171
@@ -53,6 +53,7 @@
    repo.configChanged.connect(self.configChanged)   repo.repositoryChanged.connect(self.repositoryChanged) + repo.workingBranchChanged.connect(self.workingBranchChanged)     self.opts['pushafter'] = repo.ui.config('tortoisehg', 'cipushafter', '')   self.opts['autoinc'] = repo.ui.config('tortoisehg', 'autoinc', '') @@ -131,6 +132,10 @@
  if dlg.exec_() == QDialog.Accepted:   self.opts.update(dlg.outopts)   + def workingBranchChanged(self): + 'Repository has detected a change in .hg/branch' + self.refresh() +   def repositoryChanged(self):   'Repository has detected a changelog / dirstate change'   self.refresh() @@ -146,8 +151,6 @@
  self.stwidget.refreshWctx() # Trigger reload of working context     def refresh(self): - wctx = self.repo[None] -   # Update qrefresh mode   if self.repo.changectx('.').thgmqappliedpatch():   self.commitButtonName.emit(_('QRefresh')) @@ -162,7 +165,7 @@
  self.msgcombo.reset(self.msghistory)     # Update branch operation button - cur = hglib.tounicode(wctx.branch()) + cur = hglib.tounicode(self.repo[None].branch())   if self.branchop is None:   title = _('Branch: ') + cur   elif self.branchop == False:
 
36
37
38
 
39
40
41
 
43
44
45
 
46
47
48
 
62
63
64
 
65
66
67
 
84
85
86
 
 
 
 
 
87
88
89
 
36
37
38
39
40
41
42
 
44
45
46
47
48
49
50
 
64
65
66
67
68
69
70
 
87
88
89
90
91
92
93
94
95
96
97
@@ -36,6 +36,7 @@
    configChanged = pyqtSignal()   repositoryChanged = pyqtSignal() + workingBranchChanged = pyqtSignal()     def __init__(self, repo):   QObject.__init__(self) @@ -43,6 +44,7 @@
  self.busycount = 0   repo.configChanged = self.configChanged   repo.repositoryChanged = self.repositoryChanged + repo.workingBranchChanged = self.workingBranchChanged   self.recordState()   self.startTimer(500)   @@ -62,6 +64,7 @@
  self._dirstatemtime = os.path.getmtime(self.repo.join('dirstate'))   self._parentnodes = self.repo.opener('dirstate').read(40)   self._repomtime = self._getrepomtime() + self._branchmtime = os.path.getmtime(self.repo.join('branch'))   except EnvironmentError, ValueError:   pass   @@ -84,6 +87,11 @@
  self.recordState()   self.repo.thginvalidate()   self.repositoryChanged.emit() + mtime = os.path.getmtime(self.repo.join('branch')) + if mtime > self._branchmtime: + self.recordState() + self.repo.dirstate.invalidate() + self.workingBranchChanged.emit()     def _checkdirstate(self):   'Check for new dirstate mtime, then working parent changes'