If you’re in the kind of situation of using perfarce with Perforce, after upgrade to Mercurial 1.9, you may need the patch at this moment(perfarce changeset c05711ba688f):

diff -r c05711ba688f perfarce.py
--- a/perfarce.py	Fri Apr 15 14:22:16 2011 +0100
+++ b/perfarce.py	Wed Jul 06 11:04:34 2011 +0800
@@ -77,17 +77,17 @@ Five built-in commands are overridden:
            the p4 depot. Directory and filename case is preserved.
            These two setting are workarounds to handle Perforce depots
            containing a path spelled differently from file to file
            (e.g. path/foo and PAth/bar are in the same directory),
            or where the same file may be spelled differently from time
            to time (e.g. path/foo and path/FOO are the same object).
 '''
 
-from mercurial import cmdutil, commands, context, copies, encoding, error, extensions, hg, node, repo, util, url
+from mercurial import cmdutil, commands, context, copies, encoding, error, extensions, hg, node, repo, util, scmutil, url
 from mercurial.node import hex, short
 from mercurial.i18n import _
 
 import marshal, tempfile, os, re, string
 
 def uisetup(ui):
     '''monkeypatch pull and push for p4:// support'''
 
@@ -1279,27 +1279,27 @@ def push(original, ui, repo, dest=None, 
 
     try:
         # now add/edit/delete the files
         if mod:
             modal(_('opening for edit: %s\n'), 'edit -c %s' % use, mod, client.encodename)
 
         if mod or add:
             ui.note(_('retrieving file contents...\n'))
-            opener = util.opener(client.rootpart)
+            opener = scmutil.opener(client.rootpart)
 
             for name, mode in mod + add:
                 ui.debug(_('writing: %s\n') % name)
                 if 'l' in mode:
                     opener.symlink(ctx[name].data(), name)
                 else:
                     fp = opener(name, mode="w")
                     fp.write(ctx[name].data())
                     fp.close()
-                util.set_flags(client.localpath(name), 'l' in mode, 'x' in mode)
+                util.setflags(client.localpath(name), 'l' in mode, 'x' in mode)
 
         if add:
             modal(_('opening for add: %s\n'), 'add -f -c %s' % use, add, lambda n:n)
 
         if ntg:
             ui.note(_('opening for integrate: %s\n') % ' '.join(f[1] for f in ntg))
             for f in ntg:
                 client.runs('integrate -c %s %s %s' % (use, f[0], f[1]))