Permalink
Commits on Jan 4, 2011
  1. cmd/import-rsnapshot: eliminate use of readlink and stat commands.

    These aren't portable across operating systems.
    
    While we're here, catch some error cases that were revealed by these
    commands failing.
    
    Also reduce indentation by using 'continue' in places where the entire loop
    iteration depends on a single conditional.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Jan 4, 2011
  2. cmd/import-rsnapshot: fix some sh stylistic stuff.

    Should not affect functionality.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Jan 4, 2011
  3. Fix some 'print' to stdout that snuck in somehow.

    We should be using debug1() or debug2() instead, most of the time.  print is
    only for stuff that callers might actually want to read and parse.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Jan 4, 2011
Commits on Jan 3, 2011
  1. cmd/import-rsnapshot: fix a bashism (== instead of =).

    Bug reported by Brandon Low.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Jan 3, 2011
  2. Merge branches 'gf/ls', 'gf/tag', 'zz/import-rsnapshot' and 'bl/selfi…

    …ndex'
    
    * gf/ls:
      ls-cmd: hide files with a leading dot by default
    
    * gf/tag:
      Refuse branch/tag names that start with a dot
      tag-cmd: Some fixups
    
    * zz/import-rsnapshot:
      Adds a testcase for import-rsnapshot.
      Makes import-rsnapshot use save's -f option.
      Adds -f option to save to use a given indexfile.
      Makefile: handle shell commands (cmd/*-cmd.sh)
      Adds documentation for bup-import-rsnapshot
      Adds import-rsnapshot command.
      Adds documentation for save's strip option.
      Adds testcases for --strip and --strip-path.
      Adds a strip and strip-path option to bup save.
    
    * bl/selfindex:
      Rename receive-objects command to receive-objects-v2.
      Write idxs directly rather than using git-index-pack.
      Send SHAs from the client to reduce server load
      Use chunkyreader() instead of manually reading multiple blocks.
    apenwarr committed Jan 3, 2011
  3. Adds a testcase for import-rsnapshot.

    Also makes import-rsnapshot use $BUP_MAIN_EXE if available.
    
    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 6, 2010
  4. Makes import-rsnapshot use save's -f option.

    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 6, 2010
  5. Adds -f option to save to use a given indexfile.

    index supported -f before but save didn't.  Using a specific indexfile
    makes it possible to use temporary indexfiles for one-time-backups like
    imports.
    
    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 6, 2010
  6. Makefile: handle shell commands (cmd/*-cmd.sh)

    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 6, 2010
  7. Adds documentation for bup-import-rsnapshot

    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 6, 2010
  8. Adds import-rsnapshot command.

    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 6, 2010
  9. Adds documentation for save's strip option.

    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 6, 2010
  10. Adds testcases for --strip and --strip-path.

    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 6, 2010
  11. Adds a strip and strip-path option to bup save.

    If the strip option is given bup uses all given filenames as base paths
    and tries to stripe them from long to short.
    
    If the strip-path option is given bup strip the given prefix from all
    paths.
    
    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 6, 2010
  12. Refuse branch/tag names that start with a dot

    In git, branch and tag names are not allowed to start with a dot.
    
    In bup, we also want to enforce this since we want to avoid collision with the
    top-level special directories (.commit and .tag).
    
    Also, in save-cmd, there was an unused variable at line 286. 'oldref' is used
    and contains the same thing so get rid of 'ref'.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with apenwarr Dec 2, 2010
  13. tag-cmd: Some fixups

    * Make some error messages nicer in telling the tag name that was used.
    
    * Move tag listing code in git.py and use this code in tag-cmd and vfs.py
    
    * Make tag-cmd output the list of tags on stdout instead of stderr
    
    * Don't error out when more than 2 arguments are given. When there are less
      than 2, be nice and show the usage.
    
    * In tag-cmd, catch GitErrors that come out of git.rev_parse()
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with apenwarr Dec 2, 2010
  14. ls-cmd: hide files with a leading dot by default

    All of the frontends currently don't show hidden files by default (named with a
    leading dot).
    
    Make ls-cmd hide those files by default and add an option, '-a' or '--all', to
    make it possible to show hidden files.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with apenwarr Dec 2, 2010
  15. Rename receive-objects command to receive-objects-v2.

    ...since it's incompatible with the old one.  That will make it die more
    spectacularly when talking to an old-style server, rather than failing in
    more confusing ways.
    
    Theoretically we could do fancy things like making our server support both
    variants of receive-objects, but hey, bup is a pre-release, it shouldn't be
    acquiring backwards compatibility cruft *already* :)
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Jan 3, 2011
  16. Write idxs directly rather than using git-index-pack.

    Also add a test round trip on idx r/w.
    
    (Rearranged by apenwarr mostly due to merge conflicts.)
    
    Signed-off-by: Brandon Low <lostlogic@lostlogicx.com>
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    Brandon Low committed with apenwarr Jan 3, 2011
  17. Send SHAs from the client to reduce server load

    Signed-off-by: Brandon Low <lostlogic@lostlogicx.com>
    Brandon Low committed with apenwarr Jan 2, 2011
  18. Use chunkyreader() instead of manually reading multiple blocks.

    Signed-off-by: Brandon Low <lostlogic@lostlogicx.com>
    Brandon Low committed with apenwarr Jan 2, 2011
Commits on Dec 23, 2010
  1. Skip over invalid .idx files if we find any.

    There's no particular reason to make it fatal; just pretend they're not
    there.
    
    Zoran reported a bug where he had (it seems) some zero-length .idx files,
    which is weird, but nothing worth aborting a backup over.
    
    Also, fix _mmap_do() to be able to handle mmap'ing a zero-length file
    without an error.  It's a trivial and somewhat pointless operation, but it
    shouldn't throw an exception.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Dec 23, 2010
Commits on Dec 22, 2010
  1. cmd/server: find .idx filenames more efficiently when needed.

    Rather than mapping *all* the .idx files into memory at once just to look up
    a single object, just open/read/close them sequentially.  This should
    significantly increase the total repo size on a 32-bit system.  (Of course,
    it's still not very ideal; we really should have some kind of fallback mode
    for when our total set of indexes starts getting too big.)
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Dec 22, 2010
Commits on Dec 18, 2010
Commits on Dec 4, 2010
  1. cmd/memtest: stop using weird mmap() and /dev/urandom tricks.

    I'll just write a C function that can rapidly generate random sha1s.  This
    should make it more portable, hopefully fixing a problem reported by Michael
    Budde on a Linux/SPARC system.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Dec 4, 2010
  2. Replace a try/except/finally with a nested try block.

    try/except/finally doesn't work in python 2.4.
    mbudde committed with apenwarr Dec 4, 2010
Commits on Dec 3, 2010
  1. Use PyLong_FromUnsignedLong instead of Py_BuildValue("I")

    ...for python-pre-2.4.3 compatibility.  The "I" option was broken before
    python 2.4.3, even though it was supposed to be supported since python 2.3.
    
    Reported by Michael Budde.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Dec 3, 2010
Commits on Dec 2, 2010
  1. Renames --exclude-file to --exclude-from and encaspulates exclude-par…

    …sing.
    
    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 2, 2010
  2. Adds documentation for --exclude and --exclude-file to bup indexes ma…

    …npage.
    
    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 2, 2010
  3. Adds --exclude-file option to bup index.

    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 2, 2010
  4. Adds --exclude option to bup index and bup drecurse

    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    zoranzaric committed with apenwarr Dec 2, 2010
  5. cmd/midx: differentiate the log message from the index.py merging.

    It's a curse (inherited from git) that .idx files are called "indexes" and
    the bupindex is called an "index."  Let's change the message in cmd/midx so
    at least we'll know which kind of index people are complaining about.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Dec 2, 2010
Commits on Dec 1, 2010
  1. cmd/index: fix documented default value for --indexfile.

    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Dec 1, 2010
  2. midx: auto-remove midx files that refer to missing .idx files.

    Normally an .idx file doesn't ever disappear, but it could happen if you run
    'git gc' on your repository.  Which I thought would be a terrible idea, but
    apparently it can actually save a lot of space for some people (although it
    takes a pretty long time to run).  And when that happens, all your .idx
    files move around.  So let's be polite when that happens.  We'll print a
    warning the first time, but then shut up after that since the flawed midx
    file will just go away.
    
    Reported by Peter Rabbitson.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Dec 1, 2010
  3. add a tag command

    Currently implemented: list all tags, add a tag on a specific commit or
    head, delete a known tag.
    
    Also, make vfs expose a new directory called '/.tag' which contains a
    link for each tag to its associated commit directory situated in
    '/.commit'. Finally, make tags appear as symlinks on branch directories
    on which the tagged commit is visible.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with apenwarr Nov 26, 2010