Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable repotreeitem: store node id of revision 0 for sync widget

Changeset c8e316f1c1d7

Parent 284c81f5fe78

by Yuya Nishihara

Changes to one file · Browse files at c8e316f1c1d7 Showing diff from parent 284c81f5fe78 Diff from another changeset...

 
8
9
10
11
 
12
13
14
 
150
151
152
 
153
154
155
 
162
163
164
 
 
 
 
 
 
 
165
166
167
 
187
188
189
 
190
191
192
193
194
195
 
196
197
198
 
8
9
10
 
11
12
13
14
 
150
151
152
153
154
155
156
 
163
164
165
166
167
168
169
170
171
172
173
174
175
 
195
196
197
198
199
200
201
202
203
204
205
206
207
208
@@ -8,7 +8,7 @@
 import sys  import os   -from mercurial import hg, url, error +from mercurial import hg, url, error, node    from tortoisehg.util import hglib   @@ -150,6 +150,7 @@
  self._repo = repo   self._root = repo and repo.root or '' # local str   self._shortname = repo and repo.shortname or '' # unicode + self._basenode = repo and repo[0].node() or node.nullid     def rootpath(self):   return self._root @@ -162,6 +163,13 @@
  else:   return hglib.tounicode(os.path.basename(self._root))   + def basenode(self): + """Return node id of revision 0""" + if self._repo: + return self._repo[0].node() + else: + return self._basenode or node.nullid +   def data(self, column, role):   if role == Qt.DecorationRole:   if column == 0: @@ -187,12 +195,14 @@
  def dump(self, xw):   xw.writeAttribute('root', hglib.tounicode(self._root))   xw.writeAttribute('shortname', self.shortname()) + xw.writeAttribute('basenode', node.hex(self.basenode()))   RepoTreeItem.dump(self, xw)     def undump(self, xr):   a = xr.attributes()   self._root = hglib.fromunicode(a.value('', 'root').toString())   self._shortname = unicode(a.value('', 'shortname').toString()) + self._basenode = node.bin(str(a.value('', 'basenode').toString()))   RepoTreeItem.undump(self, xr)     def open(self, reuse=False):