# HG changeset patch
# User Adrian Buehlmann <adrian@cadifra.com>
# Date 1293993281 -3600
#      Sun Jan 02 19:34:41 2011 +0100
# Node ID 6bf39d88c8574aa4eb3676808e82f1c17225b7c1
# Parent  0935ff767285a4a1eb8c141c05bb99884c09a0db
rename util.unlink to unlinkpath

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1146,7 +1146,7 @@
                 for f in all_files:
                     if f not in repo.dirstate:
                         try:
-                            util.unlink(repo.wjoin(f))
+                            util.unlinkpath(repo.wjoin(f))
                         except OSError, inst:
                             if inst.errno != errno.ENOENT:
                                 raise
@@ -1240,7 +1240,7 @@
                     raise util.Abort(_("deletions found between repo revs"))
                 for f in a:
                     try:
-                        util.unlink(repo.wjoin(f))
+                        util.unlinkpath(repo.wjoin(f))
                     except OSError, e:
                         if e.errno != errno.ENOENT:
                             raise
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -215,7 +215,7 @@
         clearstatus(repo)
         ui.note(_("rebase completed\n"))
         if os.path.exists(repo.sjoin('undo')):
-            util.unlink(repo.sjoin('undo'))
+            util.unlinkpath(repo.sjoin('undo'))
         if skipped:
             ui.note(_("%d revisions have been skipped\n") % len(skipped))
     finally:
@@ -393,7 +393,7 @@
 def clearstatus(repo):
     'Remove the status files'
     if os.path.exists(repo.join("rebasestate")):
-        util.unlink(repo.join("rebasestate"))
+        util.unlinkpath(repo.join("rebasestate"))
 
 def restorestatus(repo):
     'Restore a previously stored status'
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3250,7 +3250,7 @@
                     continue
                 audit_path(f)
                 try:
-                    util.unlink(repo.wjoin(f))
+                    util.unlinkpath(repo.wjoin(f))
                 except OSError:
                     pass
                 repo.dirstate.remove(f)
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -829,7 +829,7 @@
         if unlink:
             for f in list:
                 try:
-                    util.unlink(self._repo.wjoin(f))
+                    util.unlinkpath(self._repo.wjoin(f))
                 except OSError, inst:
                     if inst.errno != errno.ENOENT:
                         raise
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -312,7 +312,7 @@
             if f == '.hgsubstate': # subrepo states need updating
                 subrepo.submerge(repo, wctx, mctx, wctx)
             try:
-                util.unlink(repo.wjoin(f))
+                util.unlinkpath(repo.wjoin(f))
             except OSError, inst:
                 if inst.errno != errno.ENOENT:
                     repo.ui.warn(_("update failed to remove %s: %s!\n") %
@@ -350,7 +350,7 @@
                 repo.ui.note(_("moving %s to %s\n") % (f, fd))
                 t = wctx.filectx(f).data()
                 repo.wwrite(fd, t, flags)
-                util.unlink(repo.wjoin(f))
+                util.unlinkpath(repo.wjoin(f))
             if f2:
                 repo.ui.note(_("getting %s to %s\n") % (f2, fd))
                 t = mctx.filectx(f2).data()
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -431,7 +431,7 @@
 
     return check
 
-def unlink(f):
+def unlinkpath(f):
     """unlink and remove the directory if it is empty"""
     os.unlink(f)
     # try removing directories that might now be empty
diff --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -276,7 +276,7 @@
             break
         head, tail = os.path.split(head)
 
-def unlink(f):
+def unlinkpath(f):
     """unlink and remove the directory if it is empty"""
     os.unlink(f)
     # try removing directories that might now be empty