forked from rcoder/ohloh_scm
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Darcs Support: Parses logs of newer version of darcs. Use hashes as t…
…okens instead of patch names.
- Loading branch information
1 parent
06318c4
commit 96de1cb
Showing
17 changed files
with
139 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
module OhlohScm::Adapters | ||
class DarcsAdapter < AbstractAdapter | ||
def head_token | ||
string_to_patch_names(run("cd '#{url}' && darcs changes --last 1"))[0] | ||
string_to_patch_tokens(run("cd '#{url}' && darcs changes --last 1"))[0] | ||
end | ||
|
||
def head | ||
verbose_commit(head_token) | ||
end | ||
|
||
def parent_tokens(commit) | ||
string_to_patch_names(run("cd '#{url}' && darcs changes --to-patch #{commit.token}"))[1..-1] | ||
string_to_patch_tokens(run("cd '#{url}' && darcs changes --to-match 'hash #{commit.token}'"))[1..-1] | ||
end | ||
|
||
def parents(commit) | ||
parent_tokens(commit).map {|token| verbose_commit(token)} | ||
end | ||
|
||
def string_to_patch_names(s) | ||
s.split(/\n/).select {|s| s =~ /^ \* /}.map {|s| s.sub(/^ \* /,'')} | ||
def string_to_patch_tokens(s) | ||
s.split(/\n/).select {|s| s =~ /^patch /}.map {|s| s.sub(/^patch /,'')} | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module OhlohScm::Adapters | ||
class DarcsAdapter < AbstractAdapter | ||
def patch_for_commit(commit) | ||
run("cd '#{url}' && darcs changes -p'#{commit.token}' -v") | ||
run("cd '#{url}' && darcs changes -h'#{commit.token}' -v") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
Wed Nov 3 15:49:53 PDT 2010 Simon Michael <[email protected]> | ||
patch bd7e455d648b784ce4be2db26a4e62dfe734dd66 | ||
Author: Simon Michael <[email protected]> | ||
Date: Wed Nov 3 18:49:53 EDT 2010 | ||
* add helloworld.c | ||
addfile ./helloworld.c | ||
hunk ./helloworld.c 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.