Skip to content
Snippets Groups Projects
Commit ee317dbf authored by Alexis S. L. Carvalho's avatar Alexis S. L. Carvalho
Browse files

update the branch cache at the end of addchangegroup

This should avoid a bad performance problem when the branch cache is
not up-to-date, and hgweb can't write an updated version because it
lacks permissions.
parent f2201aee
No related branches found
No related tags found
No related merge requests found
...@@ -1900,6 +1900,10 @@ ...@@ -1900,6 +1900,10 @@
del tr del tr
if changesets > 0: if changesets > 0:
# forcefully update the on-disk branch cache
self.ui.debug(_("updating the branch cache\n"))
self.branchcache = None
self.branchtags()
self.hook("changegroup", node=hex(self.changelog.node(cor+1)), self.hook("changegroup", node=hex(self.changelog.node(cor+1)),
source=srctype, url=url) source=srctype, url=url)
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
adding foo/file.txt revisions adding foo/file.txt revisions
adding quux/file.py revisions adding quux/file.py revisions
added 3 changesets with 3 changes to 3 files added 3 changesets with 3 changes to 3 files
updating the branch cache
rolling back last transaction rolling back last transaction
0:6675d58eff77 0:6675d58eff77
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
acl: acl.allow not enabled acl: acl.allow not enabled
acl: acl.deny not enabled acl: acl.deny not enabled
acl: changes have source "push" - skipping acl: changes have source "push" - skipping
updating the branch cache
rolling back last transaction rolling back last transaction
0:6675d58eff77 0:6675d58eff77
...@@ -94,6 +96,7 @@ ...@@ -94,6 +96,7 @@
acl: allowing changeset ef1ea85a6374 acl: allowing changeset ef1ea85a6374
acl: allowing changeset f9cafe1212c8 acl: allowing changeset f9cafe1212c8
acl: allowing changeset 911600dab2ae acl: allowing changeset 911600dab2ae
updating the branch cache
rolling back last transaction rolling back last transaction
0:6675d58eff77 0:6675d58eff77
...@@ -383,6 +386,7 @@ ...@@ -383,6 +386,7 @@
acl: allowing changeset ef1ea85a6374 acl: allowing changeset ef1ea85a6374
acl: allowing changeset f9cafe1212c8 acl: allowing changeset f9cafe1212c8
acl: allowing changeset 911600dab2ae acl: allowing changeset 911600dab2ae
updating the branch cache
rolling back last transaction rolling back last transaction
0:6675d58eff77 0:6675d58eff77
...@@ -578,6 +582,7 @@ ...@@ -578,6 +582,7 @@
acl: allowing changeset ef1ea85a6374 acl: allowing changeset ef1ea85a6374
acl: allowing changeset f9cafe1212c8 acl: allowing changeset f9cafe1212c8
acl: allowing changeset 911600dab2ae acl: allowing changeset 911600dab2ae
updating the branch cache
rolling back last transaction rolling back last transaction
0:6675d58eff77 0:6675d58eff77
...@@ -41,6 +41,15 @@ ...@@ -41,6 +41,15 @@
hg log -qr foo hg log -qr foo
cat .hg/branch.cache cat .hg/branch.cache
echo % push should update the branch cache
hg init ../target
echo % pushing just rev 0
hg push -qr 0 ../target
cat ../target/.hg/branch.cache
echo % pushing everything
hg push -qf ../target
cat ../target/.hg/branch.cache
echo % update with no arguments: tipmost revision of the current branch echo % update with no arguments: tipmost revision of the current branch
hg up -q -C 0 hg up -q -C 0
hg up -q hg up -q
......
...@@ -83,6 +83,15 @@ ...@@ -83,6 +83,15 @@
bf1bc2f45e834c75404d0ddab57d53beab56e2f8 default bf1bc2f45e834c75404d0ddab57d53beab56e2f8 default
4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo 4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo
67ec16bde7f1575d523313b9bca000f6a6f12dca bar 67ec16bde7f1575d523313b9bca000f6a6f12dca bar
% push should update the branch cache
% pushing just rev 0
be8523e69bf892e25817fc97187516b3c0804ae4 0
be8523e69bf892e25817fc97187516b3c0804ae4 default
% pushing everything
4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4
bf1bc2f45e834c75404d0ddab57d53beab56e2f8 default
4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo
67ec16bde7f1575d523313b9bca000f6a6f12dca bar
% update with no arguments: tipmost revision of the current branch % update with no arguments: tipmost revision of the current branch
bf1bc2f45e83 bf1bc2f45e83
4909a3732169 (foo) tip 4909a3732169 (foo) tip
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment