Mercurial > hg-stable
changeset 25282:0f28815ef066
copies: switch to using pathutil.dirname
copies had it's own dirname implementation. Now that pathutils has a common one,
let's use that instead.
author | Durham Goode <durham@fb.com> |
---|---|
date | Fri, 22 May 2015 12:58:27 -0700 |
parents | 660b178f49c7 |
children | 19d0e5efa6ca |
files | mercurial/copies.py |
diffstat | 1 files changed, 2 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/copies.py Fri May 22 12:47:18 2015 -0700 +++ b/mercurial/copies.py Fri May 22 12:58:27 2015 -0700 @@ -5,15 +5,9 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -import util +import util, pathutil import heapq -def _dirname(f): - s = f.rfind("/") - if s == -1: - return "" - return f[:s] - def _findlimit(repo, a, b): """ Find the last revision that needs to be checked to ensure that a full @@ -384,7 +378,7 @@ # examine each file copy for a potential directory move, which is # when all the files in a directory are moved to a new directory for dst, src in fullcopy.iteritems(): - dsrc, ddst = _dirname(src), _dirname(dst) + dsrc, ddst = pathutil.dirname(src), pathutil.dirname(dst) if dsrc in invalid: # already seen to be uninteresting continue