“tfpt online” with -diff… can it ignore the “Read

2019-06-04 22:12发布

问题:

I figured that adding the -diff option meant that it ignored the "Read Only" flag. What it actually does is get the union of 2 sets of files 1) those files that have their "Read Only" flag unset AND 2) those files that have been modified ("Read Only" flag can remain set)

$ tfpt online "D:\a\b\c.txt" -diff -preview
Getting your pending changes from the server...
Checking the status of D:\a\b\c.txt... Done
Walking D:\a\b\c.txt... Found 1

Showing potential changes only. No changes made.
Edits:

 edit: D:\a\b\c.txt
Showing potential changes only. No changes made.

$ tf diff  "D:\a\b\c.txt"
Comparing local to latest: D:\a\b\c.txt

$

What I'd really like is for tfpt online to ignore the "Read Only" flag and ONLY list files that have actually been modified. Is this possible?

回答1:

Unfortunately, there's no way to simply exclude the list of files that are not read-only from being pended as edits. However, you can use the "undo unchanged" command of the power tool to undo those edits that were writable but did not have content differences:

tfpt online /diff [itemspec]
tfpt uu [itemspec]

tfpt uu will compare the hashes again to determine what's unchanged from the server, so it's obviously less efficient than if you were to ignore the read-only attribute the first time, but it should ultimately solve your problem.



标签: tfs