Commit Graph
31 Commits
Author SHA1 Message Date
Mike McQuaid 47ea9117b0 versions: use bottle_filename only if f.bottle. 2013-09-22 16:01:02 +01:00
Mike McQuaid b2c8fe7e76 versions: add bottle filenames method.
Closes #22727.
2013-09-22 09:52:05 +01:00
Mike McQuaid f5af7aeef6 versions: add branch support in rev_list. 2013-09-22 09:52:05 +01:00
Mike McQuaid 8bdf158032 versions: split version_for_sha and use yield. 2013-09-22 09:52:05 +01:00
Adam Vandenberg bf5f1cafe8 Don't always show an error at the end of brew versions 2013-07-03 10:06:11 -07:00
Adam Vandenberg bbb9ad2a21 versions: pass string to factory
Closes #20951.
2013-07-01 16:46:05 -07:00
Adam Vandenberg 3aca060b8f Add 'unload' 2013-06-29 16:44:45 -07:00
Jack Nagel 03a4ecfbca Allow brew versions to work with underspecified formulae 2013-04-27 14:44:48 -05:00
Jiang Xin 885292e16e versions: work for tapped formulae
brew versions is hardcoded to cd to HOMEBREW_REPOSITORY before running
git, and as such fails to report previous versions for any formulae
from a tapped repository.

Add two new private methods repository and entry_name to replace the
hardcoded HOMEBREW_REPOSITORY and formula path, and brew versions
work for both builtin and tapped formulae.

Closes #12356.
Closes #19069.

Reported-by: Misty De Meo <mistydemeo@gmail.com>
Suggested-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-04-11 23:45:15 -05:00
Jack Nagel ee2e2bc74b versions: add debug output 2013-03-21 17:05:02 -05:00
Jack Nagel bf5d55a9d7 versions: remove unnecessary variable 2013-03-21 17:04:54 -05:00
Russell Teabeault 2827daed78 versions: unload constant before calling Formula.factory
Closes #18634.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-03-21 13:26:56 -05:00
Jack Nagel d0c5317207 versions: remove FIXME
I understand how this works now, and it is definitely necessary.
2013-03-18 15:10:37 -05:00
Jack Nagel 4affbabfb7 Replace version strings with Version objects 2012-08-18 11:12:08 -05:00
Jack Nagel 76604c1cd5 Unify 'which' and which_s' utility methods
'which' only returns a Pathname or nil, and doesn't care about anything
sent to stderr, so just silence it by default and combine the two
methods.

Closes #12115.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-07 21:05:47 -05:00
Mike McQuaid 9c16145d8c Set MACOS_VERSION as 0 on non-OSX platforms. 2012-03-18 15:43:39 +13:00
Max Howell 5329bbc7bb Tell user to `brew update' if no .git 2012-03-16 00:35:49 +00:00
Jack Nagel bc14dcf976 Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-04 00:27:05 -06:00
Jack Nagel be18671765 versions: ignore NameError and ArgumentError
Fixes #9856.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-29 16:00:27 -06:00
Jack Nagel 8975242faa versions: fix up error handling
Now we handle some things more explicitly and in the process get rid of
the blanket rescue on the mktemp block, which is something of an
antipattern.

By unloading the class *after* determining the version, we avoid the
case where the class had previously been unloaded but Formula.factory
failed, and trying to unload the nonexistent class results in a
NameError. Doing it this way, we avoid having to rescue NameError and
thereby avoid hiding other cases where it may occur.

We also rescue TypeError which gets us past a few more bad formula in
the history in some instances.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-27 03:40:24 -06:00
Jack Nagel 1be8f8c6e2 versions: silence 'aka' warning and syntax errors
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-26 23:02:18 -06:00
Dylan Smith f8599aaa2c versions: don't print 'nil' when stdout is not a tty
Closes #8960.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-24 12:21:08 -06:00
Jack Nagel ed2202d349 versions: use the actual class name when unloading
And document a bit more why this hack is present.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-12 01:16:02 -06:00
Jack Nagel 483d41c7ef versions: unload old class before obtaining version
This is silly, but I am no Rubyist and I don't have time to
figure out why Formula.factory(foo).url works as expected but
Formula.factory(foo).version does not.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-06 22:07:45 -06:00
Jack Nagel b26e66fa46 versions: enable '--compact' output
This will be useful for shell tab completion when something like `brew
install <formula> --version <version>` is implemented.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-06 14:51:15 -06:00
Jack Nagel 49bb7b65a5 versions: determine version from a Formula instance
Rather than regex the output of `git show <rev>:<path>`, we write the
output of `git cat-file blog <rev>:<path>` to a temporary file, and then
operate on it just as we would a normal formula.

I haven't observed any speed difference. `git cat-file blob` is faster
than `git show`, but the "slow part" is still the git-rev-list
invocation. But really it's pretty fast overall.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-06 14:51:15 -06:00
Max Howell c32315b566 Fix nil handling in brew versions
Fixes #7392.
2011-09-05 09:44:53 +01:00
Max Howell cbbad7a8d9 Prettier brew versions output 2011-08-02 14:45:37 +01:00
Max Howell 99448364f4 Oops, show proper git checkout command 2011-08-02 12:58:16 +01:00
Max Howell 5a21942563 Improvements to brew versions
The output happens as it is determined, rather than all at once, which is preferable for CLI commands. This meant I had to hard-code the left-justification.

The pre-amble warning is removed. Instead the command outputs the git checkout command for each she that you can type to get that old formula.

I decided that reseting the one file will work 99% of the time and that it is too risky to reset the whole repo, this will roll-back bug fixes. Instead we should add functionality to compat/ in order to support old formula as required. Sometimes deps may have to be rolled-back too, but the user will have to figure this out on an ad-hoc basis. We are assuming a failure sophisticated user anyway, one who would like to get old versions of stuff.

I moved most of the functions into Formula since IMO this makes more conceptual sense.

I made the she get abbreviated by git (using --abbrev-commit) itself so it as short as can be.
2011-08-02 12:34:33 +01:00
Sebastian Staudt 0b1f677b82 Added new command "versions" 2011-08-02 10:35:30 +01:00