Skip to content

Commit

Permalink
deprecate braid setup
Browse files Browse the repository at this point in the history
each command runs it internally before doing its thing
  • Loading branch information
cristibalan committed Oct 28, 2008
1 parent 3b69a4d commit 2760fb1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
7 changes: 3 additions & 4 deletions bin/braid
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,17 @@ Main {

mode(:setup) {
description <<-TXT
Set up git and git-svn remotes.
Deprecated: braid setup is no longer required and is now a NOOP.
All commands that need a remote setup, will set it up themselves.
TXT

examples <<-TXT
. braid setup local/dir
TXT

mixin :optional_path, :option_verbose

run {
Braid.verbose = verbose
Braid::Command.run(:setup, path)
puts description
}
}

Expand Down
4 changes: 4 additions & 0 deletions lib/braid/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def config
end

private
def setup_remote(mirror)
Command.run(:setup, mirror.path)
end

def use_local_cache?
Braid.use_local_cache
end
Expand Down
4 changes: 0 additions & 4 deletions lib/braid/commands/add.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ def run(url, options = {})
end
end

private
def setup_remote(mirror)
Command.run(:setup, mirror.path)
end
end
end
end
2 changes: 2 additions & 0 deletions lib/braid/commands/diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module Commands
class Diff < Command
def run(path)
mirror = config.get!(path)
setup_remote(mirror)

diff = mirror.diff
puts diff unless diff.empty?
end
Expand Down
3 changes: 3 additions & 0 deletions lib/braid/commands/remove.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ def run(path)

git.rm_r(mirror.path)

# will need this in case we decide to remove the .git/config entry also
# setup_remote(mirror)

config.remove(mirror)
add_config_file

Expand Down
1 change: 1 addition & 0 deletions lib/braid/commands/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def update_one(path, options = {})
end
end

setup_remote(mirror)
mirror.fetch

new_revision = validate_new_revision(mirror, options["revision"])
Expand Down

0 comments on commit 2760fb1

Please sign in to comment.