How do I configure Textmate2 to turn off Soft Wrap by default for all files? - textmate2

I put a .tm_properties file in my home folder and also at the top of my source tree with the following in it, none of the versions had any effect.
softWrap = false
softWrap = :false
softWrap=false
Also with no effect, I put the line below section headers such as:
[ source ]
[ text ]
[ "*.*" ]
Would love to know what I'm missing here.

I have the following entry below and it work just fine. Try removing other file type specific configuration to ensure its not being overridden.
softWrap = false
Also do check the "global" defaults under
TextMate.app/Contents/Resources/Default.tmProperties
If you haven't already seen https://gist.github.com/1478685, do check it out. The tm_properties in your most immediate folder should take priority. So try and remove other setting and just test it with this one.
Alternatively, remove all other tm_properties and just leave the "global" one and test it out.
Finally do check out this discussion and the version of TM2 you are using. There have been certain fixes to softwarp, and it could just be a bug that you are facing.
EDIT
Also just FYI, I found this item in the latest release notes of TM2.(2012-02-18)
Cached .tm_properties files are now observed via kevent so changes invalidate the cache immediately (previously it could take up to 30 seconds before the updated file was read). On file systems without kevent support you need to relaunch TextMate to flush the cache.

Related

PTC Integrity batch update member revision

Is there a way to update the member revision of a big list of files via command line?
I can't use :working or :head but have to specify a different revision for each file.
As far as I know --selectionFile only takes paths as input, but not the revision numbers.
edit: I wanted to set member a very big list of files and I wanted to avoid writing the command si updaterevision ... for every file, as it takes ages to complete for that many files. Instead I wanted to know if there is a more advanced method to specify a list of files and their revisions to be able to run the updaterevision only once (like it is with :working) for the whole list of files.
But as it is said in the comment there is no such possibility.
edit2: I use MKS for a couple of years now and as I now know, there is no such possibility (at least up to MKS 11.6) to update many files to different revisions with one single command line call. But using one call per member, as was proposed, made the whole operation take up to several hours as I had many thousands of members in the sandbox and MKS needs some time to complete each sicommand.
Some time already passed since you asked for this question, here is my comment in case it could still be useful for you in the future.
First, It is not completely clear what you want to achieve. Please be more descriptive and if possible provide example.
What I understand as of now is you need to set bunch of files listed as member revision thru the command line. This is fairly simple, the most complicated is actually to have the list of files to be updated to member and the revision that you want to set as member.
I recommend you to create a batch file with the commands to make each file member. You can use Regex to do it very quick and without much trouble.
Here is an example for updating one file member revision:
si updaterevision --hostname=servername --port=portnumber --user=username --changepackageid=5873763:2 --revision=:working myfile_a1.c
where
servername = the name of the server where your sandbox is located
portnumber = the port that provides access to the server for your sandbox
username = your login user id
changepackageid = here you change the number to use your defined TASK:ChangePackage for this changes
revision = if you have a working revision that you want now to become member, just use "working" as revision, otherwise you can define specific revision number, e.g. revision=1.2
At the end you define the name of the file you want to update.
Go to you sandbox root folder, open CMD window, and run the batch file. It will execute each line applying your changes.
If you have a list of files with the revision you want as member, you can use REGEX to convert it into a batch file.
Example list of files in text file:
file1.c 1.10
file3.c 1.19
sec_file1.c 1.1.2.1
support.h 1.7
Use notepad++ or other text editor with regex support and run this search:
Once you know which regex apply, you can now use it in the notepad++ to do a simple search and replace:
Search = ([\w].[\D])\s+([\d.]+).*
Replace = si updaterevision --hostname=servername --port=portnum --user=userid --changepackageid=6123933:4 --revision=\2 \1
\1 => FileName
\2 => File revision
See image below as example:
Finally just save doc as batch file and run it.
Just speculating that if you have a large list of members along with the member revision you want to update to, then you also have an sandbox that served you to generate this list.
If so my approach would be
c:\MySandbox> si updaterevision --recurse --revision=:working
If your member/revision list come from a development path you could first have a sandbox targeting that devpath, resync, (close thesandbox if opened in gui), retarget the sandbox to the destination devpath (or mainline) you want and then issue the command above.
For an single member approach I would use 'si rlog' to generate a list of si-commands directly
si rlog -R --noheaderformat --notrailerformat --revision=:working --format="si updaterevision {membername} --revision={revision}\r\n" > updaterevs.bat.txt
Review updaterevs.bat.txt rename it to updaterevs.bat and ecxecute it.
(Be careful if using it on other sandboxes)
Other interesting readings here might be the "snapshot sandbox" feature,
checkpointing in general and variants rsp. devpaths.
Using only these features might be politically more correct in the philosophy of Integrity.

Modify or extend default settings for a project

In a sublimetext3 project, is there a way to modify or extend, not replace, default settings?
To be specific, in a project I specify the paths of the folders to include in the project. Each folder has files and directories unique to that folder that I want to exclude using either folder_exclude_patterns or file_exclude_patterns; see documentation for Projects.
But as I understand this, these project settings replace not extend the default settings. What I would like, however, is to have a project setting that appends to the default pattern rather than replacing it. Is this possible?
Pseudo code that expresses what I would like to do:
"folders":
[
{
"path": "c:\\dir1",
"folder_exclude_patterns": default_folder_exclude_patterns + ["junk"]
},
{
"path": "C:\\dir2"
"folder_exclude_patterns": default_folder_exclude_patterns + ["old"]
},
]
If this is not possible, then I believe the only thing I can easily do is copy the default settings and replicate them for each folder item. Since I have multiple projects/folders and need to do this for file exclude, folder exclude and binary file settings, this will get tedious and be hard to maintain. Of course, this seems like it is ripe for a plugin, but that is not in the scope of what I am looking to do. (Of course if someone else has a plugin that does something like this, I would be happy to try it out! :-))
Unfortunately, due to the way Sublime is set up, higher-precedence settings replace lower-precedence ones, not supplement them. This is a good thing because many settings are either/or - what would you do if your user settings had "highlight_line": false while a project had "highlight_line": true, for example?
A plugin should be able to do the trick. sublime.Window contains the project_data() and set_project_data() methods, which allow you to retrieve and write project settings, respectively. You could add a "more_folder_exclude_patterns" key to each folder in your project with the additional patterns you would like to add to the defaults set in your Preferences.sublime-settings file. The plugin could then check if the "more" key exists, read both arrays, concatenate them, and write the result back to the .sublime-project file, erasing the "more" key at the same time. Finally, you could set up an event listener to run the plugin whenever you wanted - on save, upon loading a new file, etc.
EDIT
Here's a working example:
import sublime
import sublime_plugin
from copy import deepcopy
class ModifyExcludedFoldersCommand(sublime_plugin.WindowCommand):
def run(self):
proj_data = self.window.project_data() # dict
orig_proj_data = deepcopy(proj_data) # for comparison later
settings = sublime.load_settings("Preferences.sublime-settings")
fep = settings.get("folder_exclude_patterns") # list
for folder in proj_data["folders"]:
try:
if folder["folder_exclude_patterns"]:
break # if f_e_p is already present, our work is done
except KeyError:
pass # if it doesn't exist, move on to mfep
try:
mfep = folder["more_folder_exclude_patterns"]
new_fep = sorted(list(set(fep + mfep))) # combine f_e_p from
# Preferences and project,
# excluding duplicates using
# a set.
folder["folder_exclude_patterns"] = new_fep
del folder["more_folder_exclude_patterns"]
except KeyError:
pass # if mfep doesn't exist, just move on to the next folder
if proj_data != orig_proj_data:
self.window.set_project_data(proj_data)
class UpdateProjectData(sublime_plugin.EventListener):
def on_activated(self, view):
window = view.window()
window.run_command("modify_excluded_folders")
Save the file as Packages/User/modify_excluded_folders.py (where Packages is the folder opened when selecting Preferences -> Browse Packages...) and it should go into effect immediately. It will run each time a view is activated. It checks for the presence of a "folder_exclude_patterns" array in each folder defined in the current .sublime-project file, and if found it assumes everything is OK and passes on to the next folder. If that array is not found, it then checks for the presence of a "more_folder_exclude_patterns" array. If found, it does its magic and merges the contents with the existing "folder_exclude_patterns" array from your preferences (Default or User). It then writes a new "folder_exclude_patterns" array into the folder and deletes the "more_folder_exclude_patterns" array. Finally, it checks to see if any changes were made, and if so it writes the new data back to the .sublime-project file.

sync two vobs file (by clearfsimport) without checking in the updated file

I am using following command to sync B vob files from A vob
clearfsimport -master -follow -nsetevent -comment $2 /vobs/A/xxx/*.h /vobs/B/xxx/
It works fine. But it will check in all the changes automatically. Is there a way to do the same task but leave the update files in a check out status?
I want to update the file for B from A. Build my programme, and then re-cover the branch. So if the updated files is an check out status, I can do unco later. Well with my command before, everything is checked in. I cann't re-cover my branch then.
Thanks.
As VonC said, it's impossible to prevent "clearfsimport" to do the check in. And he suggested to use a label to recover back.
For me, the branch where I did "clearfsimport" is branched from a label.Let's call it LABEL_01. So I guess I can use that label for recovery. Is there an easy way (one command) to recover the files under /vobs/B/xxx/ to label LABEL_01 ? I want to do it in my bash script, so the less/easy the command is, the better.
Thanks.
After having a look at the man page for clearfsimport, no, it isn't possible to prevent the checkins.
I would set a label before the clearfsimport, and modify the config spec for the new version to be created in a branch (similar to this config spec).
That way, "re-cover" the initial branch would be easy: none of the new version would have been created in it.

Get specific Version (#Label) for an old version tree

I'm having some problem to get a specific Label version for an old tree path (moved, renamed, etc..) in TFS2008.
The problem I have is the following:
I renamed and moved some portion of tree version files and folder and now I'm not able to get a specific version from a specific Label. This Label was applied on the old tree path, and when I get specific version (with overwrite options checked) appear "Not downloaded" on the Latest column and I'm not able to work on the old baseline (labelled files and folder).
There is the way to get specific version in a custom target path?
The TFPT are helpful to do this?
Thanks!
The solution is get specific version Label on the project root, so the old tree version path is proposed.
Nicola Celiento: I was about to post this as new question when I saw your question and answer, which have also worked for me.
I had a branch called $/MyProject/Dev/OldName, which was renamed to $/MyProject/Dev/NewName in May 2015. I now want to get all the files for this branch as of April 2014 (before the branch rename), but I can't work out how to do this. So far I have tried:
Creating a new workspace mapped to $/MyProject/Dev/NewName. Do Get Specific Version on $/MyProject/Dev/NewName, set Type to Date as of April 2014, set Overwrite writeable files and Overwrite all files. This results in the message: "All files are up to date. No files were updated because the requested file versions were previously downloaded. To force an update, use the "Get Specific Version" command with the "Overwrite all...) option checked." This message is odd because it is telling me to do precisely what I have done to get the message! In Source Control Explorer all files have a status of Not downloaded.
From the command line, do a get using the new branch name (does not work - no files in workspace):
C:\Workspace>tf get $/MyProject/Dev/NewName /version:D"2014-04-08 21:00:00" /overwrite /force /recursive
All files are up to date.
From the command line, do a get using the old branch name (also does not work - no files in workspace):
C:\Workspace>tf get $/MyProject/Dev/OldName /version:D"2014-04-08 21:00:00" /overwrite /force /recursive
No appropriate mapping exists for $/MyProject/Dev/OldName.
Changed my workspace to map to the old branch $/MyProject/Dev/OldName, and then repeated the previous get (also does not work - no files in workspace):
C:\Workspace>tf get $/MyProject/Dev/OldName /version:D"2014-04-08 21:00:00" /overwrite /force /recursive
C:\Projects:
Getting OldName
Using View History on individual files, I can see the files definitely existed at April 2014, and I can also see their contents, I just can't get them for that date (but I can get them OK after the branch rename).
Based on Nicola Celiento's answer the solution for me was to Get Specific Version on the root $/MyProject/Dev project. This got all the branches below $/MyProject/Dev, including the old $/MyProject/Dev/OldName that I wanted.

CruiseControl.Net Deleted Files

I'm using CC.net on against a Source Safe database, and have a problem that someone deleted some files from the database, and the deleted files weren't removed. I didn't see a config switch or anything that I could set for it to clear the code directory prior to building.
Am I missing something?
As Alex says there is a CleanCopy flag in the source code block. However, my situation was a little different. I use subversion and I found the CleanCopy flag was NOT doing what it said it would on the box.
To solve the problem I added a task which runs a batch file that clears out the build's working copy prior to checkout. It is a bit slower (about 1 min for code base of 400Mb) but guarantees no old code.
Kindness,
Dan
All you need to do is set CleanCopy to true in your source control block. The documentation is very clear on this. The above answer is the wrong way.

Resources