Fossil

Check-in [60b40f29]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:tclfossil: initial version of clone that can get first igots
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tclfossil-1
Files: files | file ages | folders
SHA1:60b40f293ade26b87719df3d308074bcc5819ebe
User & Date: mjanssen 2008-02-17 00:31:19
Original User & Date: MJanssen 2008-02-17 00:31:19
Context
2008-02-19
18:05
tclfossil: initial directory structure and package split up check-in: 2b9c6df4 user: mjanssen tags: tclfossil-1
2008-02-17
00:31
tclfossil: initial version of clone that can get first igots check-in: 60b40f29 user: mjanssen tags: tclfossil-1
2008-02-03
18:18
tclfossil: added revlist command check-in: 1c92462c user: mjanssen tags: tclfossil-1
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added tools/tclfossil/clone.tcl.





















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package require http
package require zlib
package require sha1

proc login_card {userid password message} {
   # calculates the login card for the specific user for this msg

   set nonce [sha1::sha1 -hex $message]
   set signature [sha1::sha1 -hex $nonce$password]
   return "login $userid $nonce $signature\n"
}

proc http_req {url user password message} {
  set login_card [login_card $user $password $message]
  set message [blob_compress "$login_card$message"]
  return [http::geturl $url/xfer -binary 1 -query $message -type application/x-fossil]
}


proc blob_compress {data} {
    set n [string length $data]
    set data [zlib compress $data 9]
    set header [binary format I $n]
    
    return $header$data
}

proc blob_decompress {data} {
    binary scan $data I length
    return [zlib decompress [string range $data 4 end] $length ]
} 

# send buffer starts with 4 bytes (big endian) containing the length of the blob


set tok [http_req http://www.fossil-scm.org/fossil MJanssen {} clone\n]
http::wait $tok
set body [blob_decompress [http::data $tok]] 
set lines [split $body \n] 
puts $body
puts "Received:\t[string length $body] bytes,\t[llength $lines] messages"

Added tools/tclfossil/dependencies.txt.



>
1
zlib: http://pascal.scheffers.net/software/zlib-1.1.1.tar.bz2