Don't try to restore read-only chattr(1) attributes.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Zoran Zaric <zz@zoranzaric.de>
Add symbolic mode information to xstat output, i.e. (drwxr-xr-x).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
Make "bup meta -tvv" output identical to "bup xstat".

Move the bits of xstat-cmd.py that generate the detailed metadata
representation to metadata.py and xstat.py to support their use from
both "bup xstat" and "bup meta -tvv".

Add size to detailed metadata description when available.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
Make "bup meta -tv" output look somewhat like "ls -l" output.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
Implement git.PackIdxV{1,2}.hashes_sorted_by_ofs()
Implement BitArray
Add repack command
Implement repository wide locking

Add git.lock(), git.unlock() and git.is_locked(), which handle locking
of the repository.
Add locking to repack command
Make save and repack respect a lock
unlock repository on error "No reachable objects found"

running bup repack on an empty repository left the repository locked.

Signed-off-by: Tim Riemenschneider <debian@tim-riemenschneider.de>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
also delete pack-*.vol000+200.par2 files after repack

otherwise these would be left behind

Signed-off-by: Tim Riemenschneider <debian@tim-riemenschneider.de>
[zz@zoranzaric.de: Remove the test that counts packfiles]
Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
Testcase for the missing unlock before erroring out

Signed-off-by: Tim Riemenschneider <git@tim-riemenschneider.de>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
Bugfix: repack did not work for "larger" repositories

repack only worked, if the git.PackIdxList still contained all the
*.idx files, one per *.pack file. If they got replaced by a *.midx file,
not only it traversed objects multiple times, these objects are not
considered for repack. (Since I think that the other pack-files are
untouched, no data-loss should occur)

This fix tells PackIdxList to ignore the midx-files.

Signed-off-by: Tim Riemenschneider <git@tim-riemenschneider.de>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
Fix: Use env-var BUP_MAIN_EXE

Instead of running 'bup fsck -g' (and thus require bup being in the PATH)
use the environment variable BUP_MAIN_EXE
(otherwise the testcase with par2 fails, too)

Signed-off-by: Tim Riemenschneider <git@tim-riemenschneider.de>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
Delete midx after repack

otherwise subsequent bup-runs fire warnings of missing .idx files used by the
(old) midx-file(s)

Signed-off-by: Tim Riemenschneider <git@tim-riemenschneider.de>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
A test-case for the repack-with-midx-problem

(containing a recipe to reproduce it)

Signed-off-by: Tim Riemenschneider <git@tim-riemenschneider.de>
[zz@zoranzaric.de: Remove grep-writing-objects-tests because we don't
rewrite the packfile anymore]
Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
Add test for repack to check if all objects are reachable
Implement a pre Python 2.6 fallback bin() version
Add a method to calculate the set bits ratio in a BitArray