Mercurial > public > mercurial-scm > hg-stable
diff mercurial/changelog.py @ 24822:8678b1eafbcf stable
changelog: fix readpending if no pending data exist (issue4609)
Since transaction are used for more than just changesets, it is possible
to have a transaction without new changesets at all. In this case no
''00changelog.i.a' are written. In all cases the 'changelog.readpending'
method is called if the repository has any pending data. The 'revlog' logic
provides empty content if the file is missing, so the whole operation
resulted in an empty changelog.
We now skip reading the pending file if it is missing.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 20 Apr 2015 17:16:22 +0200 |
parents | b5cd8c2f6e65 |
children | 8d81b36fa6ce |
line wrap: on
line diff
--- a/mercurial/changelog.py Mon Apr 20 15:27:55 2015 +0200 +++ b/mercurial/changelog.py Mon Apr 20 17:16:22 2015 +0200 @@ -267,6 +267,8 @@ self.checkinlinesize(tr) def readpending(self, file): + if not self.opener.exists(file): + return # no pending data for changelog r = revlog.revlog(self.opener, file) self.index = r.index self.nodemap = r.nodemap