Commit Graph

31 Commits

Author SHA1 Message Date
Allan Odgaard
546b55a407 Only fingerprint file system for hg
The problem with hg is that running ‘hg status’ may trigger fsevents, which would normally have us call ‘hg status’ again. To avoid this, we check if there actually are changes compared to the last time we ran the SCM driver. This has some overhead, as we need to scan the disk to produce the fingerprint.
2013-01-12 13:09:16 +01:00
Allan Odgaard
a222dfd805 Use libdispatch for SCM status
Additionally the throttling has been improved. Previously we would delay a status fetch if it had been less than 3 seconds since the last request, but during this “penalty wait” more requests could still be submitted (in case of disk activity) and would be queued for later execution — now such requests are dropped.
2013-01-12 13:09:16 +01:00
Allan Odgaard
45763d4afc Don’t require file to get SCM info
We didn’t actually use the file itself, only its parent directory, and there are several places we want SCM info for an untitled file’s project directory, so removing the need for a file simplifies things.
2012-09-18 17:33:02 +02:00
Allan Odgaard
170785dd52 Fix typo 2012-09-14 17:14:55 +02:00
Allan Odgaard
460185724d fixup! If path no longer have SCM info, include it in change set
The iterator checks were wrong.
2012-09-03 15:28:59 +02:00
Allan Odgaard
2b3e0bd7dc Fix excessive SCM status updates for clean repositories
The problem is that we used to treat an empty status map as meaning we hadn’t yet requested status for this repository, however, now that we no longer need status for all files, we would have an empty status map for clean (svn) repositories, leading to needlessly requesting status updates all the time (and on main thread).
2012-09-03 15:28:59 +02:00
Allan Odgaard
3a47ad6c03 SCM driver reports if system tracks directories
This can be used to make decisions about whether or not we should assign a virtual status to directories, prune them from a status display, or similar.
2012-09-03 15:28:58 +02:00
Allan Odgaard
c332ae69e6 Allow disabling SCM status from .tm_properties
This is done by adding the following (which can be limited to a folder):

    scmStatus = false
2012-09-02 17:53:50 +02:00
Allan Odgaard
92e31ec8d1 Exclude clean files from svn status
Subversion itself is roughly 30% faster if we do not ask for status of all files, the XML processing though is magnitudes faster, since it will only have to deal with a few records (in the general case) rather than a record per file (xsltproc seems to do around ~10,000 files per second on my Mac Pro, though I have no idea if it scales linearly).
2012-09-02 17:53:50 +02:00
Allan Odgaard
2d2dd62351 Change scm::status::versioned → none
The scm::status::versioned status has now been removed.

The upshot of this is that SCM drivers can leave out files that are “clean” from their status map, and TextMate will assume they have status “none” (clean). This cuts down on the amount of data that needs to be sent (and/or processed) by the SCM drivers.
2012-09-02 17:53:50 +02:00
Allan Odgaard
02b2ef3982 Change scm::status::note → unknown where applicable 2012-09-02 17:53:50 +02:00
Allan Odgaard
f3429d8aad Remove code duplication
The SCM status enumeration is now only declared once.

I also introduced an ‘unknown’ status which should be used instead of ‘none’.
2012-09-02 17:53:50 +02:00
Allan Odgaard
01e7f6df75 Use xsltproc to parse svn (XML) status output
For a repository with 7,767 files it takes 3.5 seconds for Python to convert a full file listing from XML to the simpler line-based format. Using xsltproc the same takes 0.74 seconds.

According to issue #340 TextMate “freeze for up to about 5 - 10 minutes” when doing svn status. Not sure how much this change helps on that, no doubt it’s an improvement.
2012-09-02 17:53:49 +02:00
Jeremy Whitlock
52d321b510 Replaced contents of skeleton svn_status.xsl with real content.
* Note: Column delimiter is back to four spaces due to XML/XSL not allowing control characters
2012-09-02 17:53:49 +02:00
Allan Odgaard
df3da106e0 Add svn status xslt to scm target
This is presently not used, it’s skeleton code for @whitlockjc.
2012-09-02 17:53:49 +02:00
Allan Odgaard
be6b36be08 If path no longer have SCM info, include it in change set
This allows the SCM drivers to not report status for non-modified versioned files.

The problem was previously that if a driver didn’t report status for such files, having a file go from modified → clean wouldn’t always cause a refresh, since no change notification was generated for the path.

For the svn driver there is a 50% overhead by svn itself in reporting status for files without status, this overhead is likely magnified by the following XML step (where XML for all files in the working copy needs to be parsed).
2012-09-01 14:17:47 +02:00
Allan Odgaard
74961834e0 Make svn status parser more robust
I assume issue #340 is because of unexpected output from svn which would cause problems for the parser.
2012-08-31 00:04:28 +02:00
Jeremy Whitlock
260e3d8b9d Fix missing svn status for long committer names
* Changed the Subversion status command to output XML
* Updated the status parsing to handle new XML output
2012-08-29 14:46:12 +02:00
Allan Odgaard
32a4f76244 Use initializer list syntax 2012-08-29 14:27:35 +02:00
Jacob Bandes-Storch
e3aa997b06 Use libc++: replace std::tr1 with std 2012-08-28 13:30:20 +02:00
Allan Odgaard
0cc79cf195 Add missing NULL argument to varags function
Amazing this hasn’t caused any problems, but on 64 bit it was an instant crash.
2012-08-28 11:11:33 +02:00
Allan Odgaard
5add8042c1 Create test repository with TM’s PATH/TM_SVN
This can still be fooled, as we do not read variables from TextMate’s user defaults, but I think this should solve majority of issues users are reporting.
2012-08-27 22:08:39 +02:00
Allan Odgaard
8d13174001 Gracefully handle ‘svn info’ failure
This command would e.g. fail if the repository format is of a newer date (in which case the code expecting a result would do “out of bounds” access).

Rather than split on newline, split third element on colon, and then take second element of that result, we now parse the output into a map and look for the ‘URL’ key.
2012-08-25 15:15:00 +02:00
Jeremy Whitlock
ed534778a7 New svn executable based Subversion scm driver
* Rewrote the Subversion SCM driver to use the svn executable
* Badges work just like Mercurial
* TM_SCM_BRANCH is set to the full repository URL for the working copy

See issue #273.
2012-08-25 02:06:22 +02:00
Allan Odgaard
5feaa48636 fixup! git: show modifications in upstream folders
A new ‘mixed’ state was introduced with no ‘to_s()’ support (used for debug output and the ‘scmls’ test executable).
2012-08-18 15:30:25 +02:00
Allan Odgaard
52b01e0f6e Fix test failure for builds in source tree
The fs::snapsot_t class creates a finger print of a folder. We used the source tree for testing, but if the source tree hosts the build directory, then the fingerprint will (likely) change, since we run simultaneous build jobs.

It now uses the Frameworks folder in the source tree, as it’s unlikely that someone would place their build directory in this location.
2012-08-15 02:41:15 +02:00
Clemens Lang
b08daa7f97 git test: don't fail in unconfigured envs
git commit fails when user.name and user.email aren't set. Unfortunately
using git commit --author='Test Test <test@example.com>' doesn't work.

This could happen in environments where pristine users are used to build
software.

This patch is public domain.
2012-08-12 22:26:59 +02:00
Allan Odgaard
5f55fcb514 Turn private run_cmd (scm/utility.h) → io::exec 2012-08-11 19:39:18 +02:00
Allan Odgaard
e680130eaf Move oak::basic_environment to the io framework
Previously this was under the OakSystem framework which depends on the io framework meaning that the io framework itself was unable to obtain a basic environment, which is necessary for next commit.
2012-08-11 19:31:10 +02:00
Gerd Knops
7892f5269a git: show modifications in upstream folders 2012-08-10 19:17:35 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00