Skip to content

Commit e4b76d2

Browse files
committed
Cleanup hg repo instead of using bare clone
`hg clone -U` creates bare repository. Bare repositories don't return trunk commits with *hg log -f*.
1 parent 1fd36b1 commit e4b76d2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/ohloh_scm/adapters/hg/pull.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@ def pull(from, &block)
1010
unless self.exist?
1111
run "mkdir -p '#{self.url}'"
1212
run "rm -rf '#{self.url}'"
13-
run "hg clone -U '#{from.url}' '#{self.url}'"
13+
run "hg clone '#{from.url}' '#{self.url}'"
1414
else
1515
branch_opts = "-r #{ from.branch_name }" if branch_name
1616
run "cd '#{self.url}' && hg revert --all && hg pull #{ branch_opts } -u -y '#{from.url}'"
1717
end
1818

19+
clean_up_disk
1920
yield(1,1) if block_given? # Progress bar callback
2021
end
2122

23+
private
24+
25+
def clean_up_disk
26+
return unless FileTest.exist?(url)
27+
run "cd #{url} && find . -maxdepth 1 -not -name .hg -not -name . -print0 | xargs -0 rm -rf --"
28+
end
2229
end
2330
end

0 commit comments

Comments
 (0)