##// END OF EJS Templates
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein -
r4110:20af6a2f default
parent child Browse files
Show More
@@ -0,0 +1,20 b''
1 import os
2 from mercurial import hg, ui, commands
3
4 u = ui.ui()
5
6 repo = hg.repository(u, 'test1', create=1)
7 os.chdir('test1')
8 repo = hg.repository(u, '.') # FIXME: can't lock repo without doing this
9
10 # create 'foo' with fixed time stamp
11 f = file('foo', 'w')
12 f.write('foo\n')
13 f.close()
14 os.utime('foo', (1000, 1000))
15
16 # add+commit 'foo'
17 repo.add(['foo'])
18 repo.commit(text='commit1', date="0 0")
19
20 print "workingfilectx.date =", repo.workingctx().filectx('foo').date()
@@ -0,0 +1,1 b''
1 workingfilectx.date = (1000, 0)
@@ -510,7 +510,7 b' class workingfilectx(filectx):'
510 def date(self):
510 def date(self):
511 t, tz = self._changectx.date()
511 t, tz = self._changectx.date()
512 try:
512 try:
513 return (os.lstat(repo.wjoin(self._path)).st_mtime, tz)
513 return (os.lstat(self._repo.wjoin(self._path)).st_mtime, tz)
514 except OSError, err:
514 except OSError, err:
515 if err.errno != errno.ENOENT: raise
515 if err.errno != errno.ENOENT: raise
516 return (t, tz)
516 return (t, tz)
General Comments 0
You need to be logged in to leave comments. Login now