X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-merge-recursive.py;h=37258ad77481fb0edaf2b084b7be173d8da8c586;hb=29508e1efb8d5a18f78ca0f9be45fdde49ef6b76;hp=e6cbdde71ad94303a728e0083a3375280f49a7df;hpb=46e651743ae5c0938c4ff076a0453ecc9611a520;p=git.git diff --git a/git-merge-recursive.py b/git-merge-recursive.py index e6cbdde7..37258ad7 100755 --- a/git-merge-recursive.py +++ b/git-merge-recursive.py @@ -1,10 +1,15 @@ #!/usr/bin/python +# +# Copyright (C) 2005 Fredrik Kuivinen +# -import sys, math, random, os, re, signal, tempfile, stat, errno, traceback +import sys +sys.path.append('''@@GIT_PYTHON_PATH@@''') + +import math, random, os, re, signal, tempfile, stat, errno, traceback from heapq import heappush, heappop from sets import Set -sys.path.append('''@@GIT_PYTHON_PATH@@''') from gitMergeCommon import * outputIndent = 0 @@ -288,6 +293,10 @@ def removeFile(clean, path): except OSError, e: if e.errno != errno.ENOENT and e.errno != errno.EISDIR: raise + try: + os.removedirs(os.path.dirname(path)) + except: + pass def uniquePath(path, branch): def fileExists(path): @@ -301,13 +310,13 @@ def uniquePath(path, branch): raise branch = branch.replace('/', '_') - newPath = path + '_' + branch + newPath = path + '~' + branch suffix = 0 while newPath in currentFileSet or \ newPath in currentDirectorySet or \ fileExists(newPath): suffix += 1 - newPath = path + '_' + branch + '_' + str(suffix) + newPath = path + '~' + branch + '_' + str(suffix) currentFileSet.add(newPath) return newPath