Module: Subversion::SvnCommand::ShowOrBrowseRevisions

Defined in:
lib/subwrap/svn_command.rb

Overview


:todo: Pre-fetch svn diff in the background (fork the process) so you don’t have to wait, in interactive mode. :todo: When calling this command on a single file,

  • default to not showing all that annoying list of files (-v) but yes to automatically showing diffs.

  • currently defaults to showingly only changes to this file, but should be option for View this changeset to show the full changeset

:todo: add number aliases (1) for view changeset, etc. so you can use numpad exclusively :todo: rename interactive mode to different name, s.a. browse_revisions Add –grep option to non-interactively search all changesets returned for a pattern.

Instance Method Summary collapse

Instance Method Details

#__allObject




1404
1405
1406
1407
1408
1409
# File 'lib/subwrap/svn_command.rb', line 1404

def __all
  @first_revision = '1'
  @last_revision  = 'head'
  @oldest_first_default = false
  @limit = false
end

#__author(author) ⇒ Object



1522
1523
1524
# File 'lib/subwrap/svn_command.rb', line 1522

def __author(author)
  @author_filter = author
end

#__back_to(revision) ⇒ Object



1448
1449
1450
1451
1452
# File 'lib/subwrap/svn_command.rb', line 1448

def __back_to(revision)
  @first_revision = revision
  @last_revision  = 'head'
  @oldest_first_default = false
end

#__by(author) ⇒ Object

Only show revisions that were committed by a certain author. :todo:



1519
1520
1521
# File 'lib/subwrap/svn_command.rb', line 1519

def __by(author)
  @author_filter = author
end

#__fetch_all_diffs_up_frontObject




1473
1474
1475
1476
# File 'lib/subwrap/svn_command.rb', line 1473

def __fetch_all_diffs_up_front
  # :todo:
  # So that when you're actually stepping through revisions, viewing a diff is instantaneous...
end

#__from(revision) ⇒ Object Also known as: __since


revision can be revision number or date. :todo: allow ‘yesterday’, etc. or absolute time

Use chronic?

:todo:



1441
1442
1443
1444
1445
# File 'lib/subwrap/svn_command.rb', line 1441

def __from(revision)
  @first_revision = revision
  @last_revision  = 'head'
  @oldest_first_default = true
end

#__interactiveObject



1506
1507
1508
# File 'lib/subwrap/svn_command.rb', line 1506

def __interactive
  @interactive = true
end

#__last(revision_count) ⇒ Object

:todo: if they’re not at the root of the repo, this may not give them what they want they may want the last revisions for a specific file, in which case the latest_revision will likely not be the right revision number



1456
1457
1458
1459
# File 'lib/subwrap/svn_command.rb', line 1456

def __last(revision_count)
  @first_revision = Subversion.latest_revision - revision_count.to_i + 1
  @last_revision  = Subversion.latest_revision
end

#__limit(limit) ⇒ Object



1411
1412
1413
# File 'lib/subwrap/svn_command.rb', line 1411

def __limit(limit)
  @limit = limit
end

#__newest_firstObject Also known as: __reverse, __backwards



1487
1488
1489
# File 'lib/subwrap/svn_command.rb', line 1487

def __newest_first
  @oldest_first = false
end

#__no_file_listObject



1470
# File 'lib/subwrap/svn_command.rb', line 1470

def __no_file_list;        @show_file_list = false; end

#__non_interactiveObject Also known as: __ni


Automatically fetch and print all diffs, pipe to a pager. Great for catching up on what’s new, skimming through recent commits. (Whereas intercative mode is better for investigating, searching for the right commit that corresponds to some change you noticed, etc.)



1497
1498
1499
# File 'lib/subwrap/svn_command.rb', line 1497

def __non_interactive
  @interactive = false
end

#__oldest_firstObject Also known as: __forward, __forwards, __chronological


Start at earlier revision and go forwards rather than starting at the latest revision



1480
1481
1482
# File 'lib/subwrap/svn_command.rb', line 1480

def __oldest_first
  @oldest_first = true
end

#__pagedObject



1502
1503
1504
# File 'lib/subwrap/svn_command.rb', line 1502

def __paged
  @paged = true
end

#__revision(revisions) ⇒ Object Also known as: _r




1398
1399
1400
# File 'lib/subwrap/svn_command.rb', line 1398

def __revision(revisions)
  @revisions = revisions
end

#__show_diffsObject Also known as: __auto_diffs


Show diffs automatically for each revision without the user having to press v



1463
1464
1465
# File 'lib/subwrap/svn_command.rb', line 1463

def __show_diffs
  @show_diffs = true
end

#__show_file_listObject




1469
# File 'lib/subwrap/svn_command.rb', line 1469

def __show_file_list;      @show_file_list = true; end

#__since_last_updateObject Also known as: __from_base, __since_base, __new, __whats_new



1415
1416
1417
1418
1419
# File 'lib/subwrap/svn_command.rb', line 1415

def __since_last_update
  @first_revision = '%base%'
  @last_revision  = 'head'
  @oldest_first_default = true
end

#__unreviewed_onlyObject


Only show revisions that are in need of a code review :todo:



1513
1514
1515
# File 'lib/subwrap/svn_command.rb', line 1513

def __unreviewed_only
  @unreviewed_only = true
end

#documentationObject




1391
1392
1393
1394
1395
# File 'lib/subwrap/svn_command.rb', line 1391

def documentation
  "Examples:
  > subwrap revisions --limit 5 -r {2008-06-10}:head .
  "
end