Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Fixes #6, forces to use default diff tool #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions svn_stash_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def write(self):
f.writelines(content)
f.close()
except IOError as e:
print 'registerFile cannot be created.'
print 'registerFile cannot be created.'

def obtain_last_stash(self):
length = len(self.stashes)
Expand Down Expand Up @@ -104,7 +104,7 @@ def push(self,target_file,filename_list):
else:
randkey = random.getrandbits(128) #unique identifier
self.files[target_file] = randkey
result = os.popen("svn diff " + target_file + " > " + SVN_STASH_DIR + "/" + str(randkey) + ".stash.patch").read()
result = os.popen("svn --diff-cmd diff diff " + target_file + " > " + SVN_STASH_DIR + "/" + str(randkey) + ".stash.patch").read()
result += os.popen("svn revert " + target_file).read()
#print "push " + target_file

Expand Down Expand Up @@ -139,8 +139,8 @@ def write(self):
def clear(self):
result = ""
if os.path.exists(SVN_STASH_DIR):
for target_file in self.files:
randkey = self.files[target_file]
for target_file in self.files:
randkey = self.files[target_file]
result += os.popen("rm " + SVN_STASH_DIR + "/" + str(randkey) + ".stash.patch").read()
result += os.popen("rm " + SVN_STASH_DIR + "/" + str(self.key)).read()

Expand Down Expand Up @@ -173,7 +173,7 @@ def __str__(self):
for filename in self.files:
try:
real_dir = filename + ".stash.patch"
current_dir = SVN_STASH_DIR + "/" + self.files[filename] + ".stash.patch"
current_dir = SVN_STASH_DIR + "/" + self.files[filename] + ".stash.patch"
content += print_hr()
content += "file " + real_dir
content += print_hr()
Expand Down Expand Up @@ -210,6 +210,6 @@ def is_a_current_stash(stash_id):
stash_dir_parts = stash.root_url.split("/")
stash_dir_parts = stash_dir_parts[:len(current_dir_parts)]
stash_dir = "/".join(stash_dir_parts)
if ".svn" in os.listdir(CURRENT_DIR):
if ".svn" in os.listdir(CURRENT_DIR):
return stash_dir == CURRENT_DIR
return False