monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] "monotone cat file" not binary save?


From: Thomas Haas
Subject: [Monotone-devel] "monotone cat file" not binary save?
Date: Mon, 05 Sep 2005 14:21:06 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Hi

I have a binary file in my repository and would like to retrieve an old
version of the file. I am using "monotone cat file" for the purpose.
Unfortunately, it seems like "monotone cat" is converting some NL to
CRNL. The file seems to be properly restored when using "monotone
revert" or "monotone checkout -r".

What is the best way to get a copy of an old revision of a file?

I am using monotone in Windows 2000 from a bash wrapper under cygwin.
Note: Running monotone directly from Windows cmd shell, does not solve
the problem.

Kind regards
- tom


I can reproduce the my problem using the following sequence of commands:

# Generate binary file
$ (echo -n Line 1;dd if=/dev/random bs=1 count=20; echo "") > file.bin
$ (echo -n Line 2;dd if=/dev/random bs=1 count=20; echo "") >> file.bin
$ (echo -n Line 3;dd if=/dev/random bs=1 count=20; echo "") >> file.bin

# Add file
$ monotone add file.bin
monotone: adding file.bin to working copy add set
monotone: registering .mt-attrs file in working copy
monotone: adding attribute 'manual_merge' to file file.bin to .mt-attrs

# Commit
$ monotone --branch=ch.bot.tracy.TEST commit -m Commit.
monotone: beginning commit on branch 'ch.bot.tracy.TEST'
monotone: committed revision d13fd67bf6414791c7efa07452cb4ed7c72ed9bf

# Compare files
$ monotone cat file d13fd67bf6414791c7efa07452cb4ed7c72ed9bf \
    file.bin |md5sum file.bin -
4af73ef934694e007ee9c028bdf1ac3c *file.bin
70260e8881f4ef1be1e7dee18611c596 *-

# What is this?
# Compare the files
$ monotone cat file d13fd67bf6414791c7efa07452cb4ed7c72ed9bf \
     file.bin |od -a
0000000   L   i   n   e  sp   1   M   e   F   =   N   S  em   h   =   Z
0000020   :   e   ,   d dc3  nl  fs   w   R   j  cr  nl   L   i   n   e
0000040  sp   2 sub   U ack ack   e stx  sp   l   y   U  si dc2   4   Q
0000060   9   Q   5   E enq   W  cr  nl   L   i   n   e  sp   3   -   0
0000100   V   3   &   x nul   9   ~   l   '   `   %   z   ]   j   &   n
0000120   L   !  cr  nl
0000124

$ od -a file.bin
0000000   L   i   n   e  sp   1   M   e   F   =   N   S  em   h   =   Z
0000020   :   e   ,   d dc3  nl  fs   w   R   j  nl   L   i   n   e  sp
0000040   2 sub   U ack ack   e stx  sp   l   y   U  si dc2   4   Q   9
0000060   Q   5   E enq   W  nl   L   i   n   e  sp   3   -   0   V   3
0000100   &   x nul   9   ~   l   '   `   %   z   ]   j   &   n   L   !
0000120  nl
0000121


# Note: the first NL was not changed to CRNL! Others were.
#
# Let's checkout and compare files:
$ monotone co d13fd67bf6414791c7efa07452cb4ed7c72ed9bf
$ md5sum.exe file.bin  d13fd67bf6414791c7efa07452cb4ed7c72ed9bf/file.bin
4af73ef934694e007ee9c028bdf1ac3c *file.bin
4af73ef934694e007ee9c028bdf1ac3c
*d13fd67bf6414791c7efa07452cb4ed7c72ed9bf/file.bin


$ monotone  --full-version
monotone 0.22 (base revision: 28058ae3e850229a5d8fae65415cbbf82b435377)
Running on: Windows NT/2000/XP (5.0, build 2195) on ia32 (level 6, rev 2817)
Changes since base revision:

new_manifest [10362ee0d4a3dc70c67ab38ec21db76d3d231320]

old_revision [28058ae3e850229a5d8fae65415cbbf82b435377]
old_manifest [10362ee0d4a3dc70c67ab38ec21db76d3d231320]


  Generated from data cached in the distribution;
  further changes may have been made.

  Generated from data cached in the distribution;
  further changes may have been made.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]