CDuke / sublime-tfs

Use TFS inside Sublime Text 2/3
5 stars 4 forks source link

bug on checkout file #25

Closed liupishui closed 6 years ago

liupishui commented 8 years ago

when i checkout a file named ‘/demo/index.html’,then all the files named 'index.html' in the project checkedout

flareair commented 8 years ago

+1

colewerner commented 7 years ago

I too have similar problems where the TFS plugin is checking out way more files than what is being edited. It appears to me that everything in child folders is being checked out when a single file is being edited/checked out in TFS.

kmcellhenney commented 7 years ago

+1

jefflaing commented 7 years ago

This is because the command for checkout is passing the /recursive flag. Line 73 in sublime_tfs.py is the offender I assume this is a misguided attempt to checkout a DIRECTORY. Same problem looks to happen on "Get Latest" as well - if you get latest on a file, it will get latest on all files with the same name from that point down. Ditto, and much worse, on "Checkin", since this may commit changes you did not think you were checking in.

jefflaing commented 7 years ago

Add this to the start of run_command() for a quick hack:

    def run_command(self, command, path, is_graph = False, is_tfpt = False):
        if not os.path.isdir(path) and "/recursive" in command:
            command.remove("/recursive")