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

stable thgrepo, patchctx: introduce a thgid() method for uniquely identifying a ctx

For unapplied patches, we create hash of the filename and mtime.

Changeset 4e2b3336f63b

Parent 45f6fef4520d

by Steve Borho

Changes to 2 files · Browse files at 4e2b3336f63b Showing diff from parent 45f6fef4520d Diff from another changeset...

 
507
508
509
 
 
 
510
511
512
 
507
508
509
510
511
512
513
514
515
@@ -507,6 +507,9 @@
  def thgmqunappliedpatch(self):   return False   + def thgid(self): + return self._node +   def thgmqpatchname(self):   '''Return self's MQ patch name. AssertionError if self not an MQ patch'''   patchtags = self._thgmqpatchtags()
 
38
39
40
 
41
42
43
 
45
46
47
 
 
 
48
49
50
 
111
112
113
 
114
115
116
 
38
39
40
41
42
43
44
 
46
47
48
49
50
51
52
53
54
 
115
116
117
118
119
120
121
@@ -38,6 +38,7 @@
  self._desc = ''   self._branch = ''   self._node = node.nullid + self._identity = node.nullid   self._mtime = None   self._parseerror = None   @@ -45,6 +46,9 @@
  ph = mq.patchheader(self._path)   self._ph = ph   self._mtime = os.path.getmtime(patchpath) + hash = util.sha1(self._path) + hash.update(str(self._mtime)) + self._identity = hash.digest()   except EnvironmentError:   return   @@ -111,6 +115,7 @@
  def thgmqpatchname(self): return self._patchname   def thgbranchhead(self): return False   def thgmqunappliedpatch(self): return True + def thgid(self): return self._identity     def longsummary(self):   summary = hglib.tounicode(self.description())