# HG changeset patch # User Sean Farley # Date 1452106915 28800 # Node ID bf86e3e87123a397f75733bc2a7f033d7a0b035a # Parent 6c7d26cef0cda4752c02b7478f1270a84393510b unionrepo: fix wrong rev being checked in iscensored (issue5024) diff -r 6c7d26cef0cd -r bf86e3e87123 mercurial/unionrepo.py --- a/mercurial/unionrepo.py Fri Jan 08 16:27:25 2016 +0100 +++ b/mercurial/unionrepo.py Wed Jan 06 11:01:55 2016 -0800 @@ -182,7 +182,8 @@ """Check if a revision is censored.""" if rev <= self.repotiprev: return filelog.filelog.iscensored(self, rev) - return self.revlog2.iscensored(rev) + node = self.node(rev) + return self.revlog2.iscensored(self.revlog2.rev(node)) class unionpeer(localrepo.localpeer): def canpush(self): diff -r 6c7d26cef0cd -r bf86e3e87123 tests/test-unionrepo.t --- a/tests/test-unionrepo.t Fri Jan 08 16:27:25 2016 +0100 +++ b/tests/test-unionrepo.t Wed Jan 06 11:01:55 2016 -0800 @@ -148,3 +148,22 @@ 2:68c0685446a3 repo1-2 1:8a58db72e69d repo1-1 0:f093fec0529b repo1-0 + +union repos should use the correct rev number (issue5024) + + $ hg init a + $ cd a + $ echo a0 >> f + $ hg ci -Aqm a0 + $ cd .. + $ hg init b + $ cd b + $ echo b0 >> f + $ hg ci -Aqm b0 + $ echo b1 >> f + $ hg ci -qm b1 + $ cd .. + +"hg files -v" to call fctx.size() -> fctx.iscensored() + $ hg files -R union:b+a -r2 -v + 3 b/f (glob)