Ticket #263 (closed enhancement: duplicate)

Opened 4 years ago

Last modified 2 years ago

Use hg archive for Mercurial mode=copy

Reported by: Almad Owned by: Almad
Priority: major Milestone: 0.8.+
Version: 0.7.7 Keywords:
Cc: marcusl

Description

On mode=copy, Buildbot is using cp -rp for copying source to build, copying whole history of repository.

Using hg archive source build would copy only tip, speeding up whole process a lot for bigger repositories.

Attachments

mercurial_copy_with_archive.diff Download (1.3 KB) - added by Almad 4 years ago.
hg archive instead of cp -rp for mercurial backend

Change History

Changed 4 years ago by Almad

hg archive instead of cp -rp for mercurial backend

comment:1 Changed 4 years ago by Almad

  • Owner set to Almad
  • Status changed from new to assigned

I'vee attached patch that works for me in our environment.

However, this patch breaks tests for mercurial. After examining tests, I guess it's feature: hg archive copies actual repository version, while cp -rp copies working copy version - and tests are using touch to add new files to repo, not followed by add+commit.

From buildbot's perspective, I'd say that mine version makes more sense, as there is no reason to have custom files in repo.

Sending e-mail to -devel list, as this requires "architectonical" change, I guess.

comment:2 Changed 3 years ago by marcusl

  • Cc marcusl added

comment:3 Changed 3 years ago by dustin

  • Milestone changed from undecided to 0.7.+

I like this change. Do you think you can fix the tests to not assume the working copy itself will be copied?

comment:4 Changed 3 years ago by Almad

Well, I can definitely try, but there was a discussion back there that this should not be default behaviour.

It probably makes sense and whole new mode (mode=export/archive?) should be implemented, which is however too much work for me, as I'm not so familiar with how commands are implemented in bb.

If hg archive is wanted in upstream, I can take a look. Perhaps same change should be implemented for git et al...?

comment:5 Changed 3 years ago by Almad

This is related to #276

comment:6 Changed 3 years ago by marcusl

There is an export mode in buildbot already. Necessary steps:

  • Set the metadir member variable to '.hg' in tests (both Mercurial & MercurialInRepo?)
  • The source step should implement this mode, checking self.mode and acting on it as appopriate.

comment:7 Changed 2 years ago by dustin

  • Status changed from assigned to closed
  • Resolution set to duplicate

See #669.

Note: See TracTickets for help on using tickets.