The phase information is not always up to date

Idan Kamara idankk86 at gmail.com
Wed Jan 25 08:41:58 CST 2012


On Wed, Jan 25, 2012 at 4:14 PM, Angel Ezquerra Moreu
<angel.ezquerra at gmail.com> wrote:
>
> Hi,
>
> I originally sent the following question to the TortoiseHg developers
> mailing list. In there Steve suggested that this may be a mercurial
> issue.
>
> As you may know I am working on adding phase support to TortoiseHg. I
> got everything mostly working, but I have a problem. I added an
> (optional) column to the tortoisehg workbench which shows the phase of
> each revision. I also added a way to change the phase of a particular
> revision. The problem is that TortoiseHg does not update the phase
> column when you change the phase of a revision, even after I hit the
> refresh button. I must close the repository tab and open it again in
> order to get the updated phase information. Sometimes even this does
> not work, and I must restart the workbench to update the phase info!
>
> Steve said that this usually means the repository is holding on to
> cached data and is not releasing it when the repository is
> invalidated. However it may also be that I am doing something wrong.
> Do you have any suggestions to further debug this problem?

I don't know how THG works exactly but I'm assuming it caches the
repo object in a similar fashion to the cmdserver, which is also
suffering from this problem as this failing test shows (it should pass):

# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1327502096 -7200
# Branch stable
# Node ID d556164d6bc26f37505d0eb8b750ff54b2a043ce
# Parent  9a6aaa35fdbd9bd75698e6e27fc977e35786c9bc
[mq]: phasetest

diff --git a/tests/test-commandserver.py b/tests/test-commandserver.py
--- a/tests/test-commandserver.py
+++ b/tests/test-commandserver.py
@@ -185,6 +185,12 @@
     os.system('hg tag -r 0 foo')
     runcommand(server, ['id', '-t', '-r', '0'])

+def setphase(server):
+    readchannel(server)
+    runcommand(server, ['phase', '-r', '.'])
+    os.system('hg phase -r . -p')
+    runcommand(server, ['phase', '-r', '.'])
+
 if __name__ == '__main__':
     os.system('hg init')

@@ -203,3 +209,4 @@
     check(outsidechanges)
     check(bookmarks)
     check(tagscache)
+    check(setphase)
diff --git a/tests/test-commandserver.py.out b/tests/test-commandserver.py.out
--- a/tests/test-commandserver.py.out
+++ b/tests/test-commandserver.py.out
@@ -118,3 +118,10 @@

  runcommand id -t -r 0
 foo
+
+testing setphase:
+
+ runcommand phase -r .
+2: draft
+ runcommand phase -r .
+2: public


More information about the Mercurial-devel mailing list