projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rebase: one safety net, one bugfix and one optimization.
[git.git]
/
git-merge-recursive.py
diff --git
a/git-merge-recursive.py
b/git-merge-recursive.py
index
21f1e92
..
0129233
100755
(executable)
--- a/
git-merge-recursive.py
+++ b/
git-merge-recursive.py
@@
-3,11
+3,13
@@
# Copyright (C) 2005 Fredrik Kuivinen
#
# 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
from heapq import heappush, heappop
from sets import Set
-sys.path.append('''@@GIT_PYTHON_PATH@@''')
from gitMergeCommon import *
outputIndent = 0
from gitMergeCommon import *
outputIndent = 0
@@
-243,7
+245,7
@@
def updateFileExt(sha, mode, path, updateCache, updateWd):
try:
createDir = not stat.S_ISDIR(os.lstat(p).st_mode)
try:
createDir = not stat.S_ISDIR(os.lstat(p).st_mode)
- except
:
+ except
OSError:
createDir = True
if createDir:
createDir = True
if createDir:
@@
-291,6
+293,10
@@
def removeFile(clean, path):
except OSError, e:
if e.errno != errno.ENOENT and e.errno != errno.EISDIR:
raise
except OSError, e:
if e.errno != errno.ENOENT and e.errno != errno.EISDIR:
raise
+ try:
+ os.removedirs(os.path.dirname(path))
+ except OSError:
+ pass
def uniquePath(path, branch):
def fileExists(path):
def uniquePath(path, branch):
def fileExists(path):
@@
-304,13
+310,13
@@
def uniquePath(path, branch):
raise
branch = branch.replace('/', '_')
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
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
currentFileSet.add(newPath)
return newPath