SVN Question

Discussion in 'NZ Computing' started by Adam Cameron, Jan 22, 2007.

  1. Adam Cameron

    Adam Cameron Guest

    G'day
    Anyone use Subversion(*) here?

    I'm sure it must be possible to extract/export JUST the files touched
    between two revisions, but I cannot for the life of me work out how.

    I can checkout everything from the get-go to [a revision].
    I can export up to specific revision.
    I can LIST the files changed between the revisions with SVN DIFF

    I can't work out how to fish them out, though.

    I thought the pegrev argument for svn export might do it, but it didn't
    seem to have a discernable difference on the end result.

    I realise I could write a script to use the output from the DIFF and pump
    that through an export or a check-out of something, but that seems like a
    real crap approach to the problem.

    I suspect I'm just being thick, and it's dead obvious.

    Any ideas?

    Cheers.

    --
    Adam

    (*) if you prefer CVS or VSS or something else, good for you. 8-|
    Adam Cameron, Jan 22, 2007
    #1
    1. Advertising

  2. In message <10md80d7x93xp.s8gx1h6ueym9$>, Adam Cameron wrote:

    > Anyone use Subversion(*) here?


    I have started to use it since I got an assistant to do work for a client.

    > I'm sure it must be possible to extract/export JUST the files touched
    > between two revisions, but I cannot for the life of me work out how.


    I suspect that this is not a common need, given that Subversion is designed
    to manage entire revisions to sets of files.

    I've had a look through the table of contents for the Subversion book
    <http://svnbook.red-bean.com/nightly/en/index.html>, and I couldn't see
    anything that does what you want.

    > I realise I could write a script to use the output from the DIFF and pump
    > that through an export or a check-out of something, but that seems like a
    > real crap approach to the problem.


    I suspect that's how you'll have to do it. Though you could use the "svn
    cat" command to get the actual file contents.

    > (*) if you prefer CVS or VSS or something else, good for you. 8-|


    There are other version-control systems with different philosophies that
    make them suitable for different uses, but CVS isn't one of them. :)
    Lawrence D'Oliveiro, Jan 22, 2007
    #2
    1. Advertising

  3. Adam Cameron

    Phil Guest

    Adam Cameron wrote, On 23/01/07 5.01 a:
    > G'day
    > Anyone use Subversion(*) here?
    >
    > I'm sure it must be possible to extract/export JUST the files touched
    > between two revisions, but I cannot for the life of me work out how.


    Try something like :

    svn cp -r 23:25 [src] [dest]

    You might be able to just grab a copy of the changes to your working
    copy with 'COMMITTED:BASE', but I'm not sure if it counts your WC
    changes as a 'revision'.

    -Phil
    Phil, Jan 23, 2007
    #3
  4. In message <>, Phil wrote:

    > Adam Cameron wrote, On 23/01/07 5.01 a:
    >> G'day
    >> Anyone use Subversion(*) here?
    >>
    >> I'm sure it must be possible to extract/export JUST the files touched
    >> between two revisions, but I cannot for the life of me work out how.

    >
    > Try something like :
    >
    > svn cp -r 23:25 [src] [dest]


    ldo@theon:hack> svn copy -r 23:25 svn+ssh://subversion@host/project/trunk/ try/
    svn: Revision range is not allowed
    Lawrence D'Oliveiro, Jan 23, 2007
    #4
  5. Adam Cameron

    Phil Guest

    Lawrence D'Oliveiro wrote, On 23/01/07 7.08 p:
    > In message <>, Phil wrote:
    >
    >> Adam Cameron wrote, On 23/01/07 5.01 a:
    >>> G'day
    >>> Anyone use Subversion(*) here?
    >>>
    >>> I'm sure it must be possible to extract/export JUST the files touched
    >>> between two revisions, but I cannot for the life of me work out how.

    >> Try something like :
    >>
    >> svn cp -r 23:25 [src] [dest]

    >
    > ldo@theon:hack> svn copy -r 23:25 svn+ssh://subversion@host/project/trunk/ try/
    > svn: Revision range is not allowed
    >


    armisael:~% svn help cp
    copy (cp): Duplicate something in working copy or repository,
    remembering history.
    usage: copy SRC DST

    ....

    Valid options:
    -r [--revision] arg : ARG (some commands also take ARG1:ARG2 range)


    -Phil
    Phil, Jan 23, 2007
    #5
  6. Adam Cameron

    Phil Guest

    Phil wrote, On 23/01/07 5.33 p:
    > Adam Cameron wrote, On 23/01/07 5.01 a:
    >> G'day
    >> Anyone use Subversion(*) here?
    >>
    >> I'm sure it must be possible to extract/export JUST the files touched
    >> between two revisions, but I cannot for the life of me work out how.

    >
    > Try something like :
    >
    > svn cp -r 23:25 [src] [dest]
    >
    > You might be able to just grab a copy of the changes to your working
    > copy with 'COMMITTED:BASE', but I'm not sure if it counts your WC
    > changes as a 'revision'.


    Also try 'svn export' too, it gives you a clean copy.

    -Phil
    Phil, Jan 23, 2007
    #6
  7. In message <>, Phil wrote:

    > Lawrence D'Oliveiro wrote, On 23/01/07 7.08 p:
    >> In message <>, Phil wrote:
    >>
    >>> Adam Cameron wrote, On 23/01/07 5.01 a:
    >>>> G'day
    >>>> Anyone use Subversion(*) here?
    >>>>
    >>>> I'm sure it must be possible to extract/export JUST the files touched
    >>>> between two revisions, but I cannot for the life of me work out how.
    >>> Try something like :
    >>>
    >>> svn cp -r 23:25 [src] [dest]

    >>
    >> ldo@theon:hack> svn copy -r 23:25
    >> svn+ssh://subversion@host/project/trunk/ try/ svn: Revision range is not
    >> allowed

    >
    > armisael:~% svn help cp
    > copy (cp): Duplicate something in working copy or repository,
    > remembering history.
    > usage: copy SRC DST
    >
    > ...
    >
    > Valid options:
    > -r [--revision] arg : ARG (some commands also take ARG1:ARG2
    > range)


    So give an example of your way of doing things that works.
    Lawrence D'Oliveiro, Jan 23, 2007
    #7
  8. Adam Cameron

    Adam Cameron Guest

    >>
    >> Valid options:
    >> -r [--revision] arg : ARG (some commands also take ARG1:ARG2
    >> range)

    >
    > So give an example of your way of doing things that works.


    Yeah. I found SVN HELP a bit misleading in this regard. When it says
    "some commands", it doesn't mean "some options of THIS command" (eg: some
    permutation of options within svn cp, in this case), it means "some SVN
    commands which have this argument", eg: svn cp and svn diff have this
    argument, and in svn cp, one cannot give it a range, but in svn diff, one
    can. Confusing.

    Some of the SVN docs are good. Some are a bit lacking. But on the whole
    it's a good product, and I've ahd very little hassle with it.

    --
    Adam
    Adam Cameron, Jan 23, 2007
    #8
  9. Adam Cameron

    Phil Guest

    Phil wrote, On 23/01/07 11.29 p:
    > Phil wrote, On 23/01/07 5.33 p:
    >> Adam Cameron wrote, On 23/01/07 5.01 a:
    >>> G'day
    >>> Anyone use Subversion(*) here?
    >>>
    >>> I'm sure it must be possible to extract/export JUST the files touched
    >>> between two revisions, but I cannot for the life of me work out how.

    >> Try something like :
    >>
    >> svn cp -r 23:25 [src] [dest]
    >>
    >> You might be able to just grab a copy of the changes to your working
    >> copy with 'COMMITTED:BASE', but I'm not sure if it counts your WC
    >> changes as a 'revision'.

    >
    > Also try 'svn export' too, it gives you a clean copy.


    Scratch that. It doesn't support revision ranges either.

    -Phil
    Phil, Jan 23, 2007
    #9
  10. Adam Cameron

    Phil Guest

    Lawrence D'Oliveiro wrote, On 23/01/07 11.44 p:
    >> armisael:~% svn help cp
    >> copy (cp): Duplicate something in working copy or repository,
    >> remembering history.
    >> usage: copy SRC DST
    >>
    >> ...
    >>
    >> Valid options:
    >> -r [--revision] arg : ARG (some commands also take ARG1:ARG2
    >> range)

    >
    > So give an example of your way of doing things that works.


    I never said I knew if it worked, I just presumed the documentation had
    at least some relationship to what the command actually supported.

    -Phil
    Phil, Jan 23, 2007
    #10
  11. In message <>, Phil wrote:

    > Lawrence D'Oliveiro wrote, On 23/01/07 11.44 p:
    >
    >>In message <>, Phil wrote:
    >>
    >>> Lawrence D'Oliveiro wrote, On 23/01/07 7.08 p:
    >>>> In message <>, Phil wrote:

    >>
    >>>>> Try something like :
    >>>
    >>>>> svn cp -r 23:25 [src] [dest]

    >>
    >>>> ldo@theon:hack> svn copy -r 23:25
    >>>> svn+ssh://subversion@host/project/trunk/ try/ svn: Revision range is
    >>>> not allowed
    >>>
    >>> armisael:~% svn help cp
    >>> copy (cp): Duplicate something in working copy or repository,
    >>> remembering history.
    >>> usage: copy SRC DST
    >>>
    >>> ...
    >>>
    >>> Valid options:
    >>> -r [--revision] arg : ARG (some commands also take ARG1:ARG2
    >>> range)

    >>
    >> So give an example of your way of doing things that works.

    >
    > I never said I knew if it worked, I just presumed the documentation had
    > at least some relationship to what the command actually supported.


    Whereas my example clearly showed that it didn't work.
    Lawrence D'Oliveiro, Jan 23, 2007
    #11
  12. Adam Cameron

    jasen Guest

    On 2007-01-22, Adam Cameron <> wrote:
    > G'day
    > Anyone use Subversion(*) here?


    been using it for about 18 months.

    > I'm sure it must be possible to extract/export JUST the files touched
    > between two revisions, but I cannot for the life of me work out how.


    hmm, I can't see a way

    Bye.
    Jasen
    jasen, Jan 24, 2007
    #12
  13. In message <ikkueo6z3olv.1wb912kszd6b1$>, Adam Cameron wrote:

    > ... in svn cp, one cannot give [the -r option] a range, but in svn diff,
    > one can. Confusing.


    The reason is that svn copy doesn't do what we thought it did
    <http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.copy.html>.

    For svn diff, the range isn't a range, it's a pair of revision numbers to be
    compared (which can also be explicitly attached to the two targets to be
    compared) <http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.diff.html>.

    Think of svn help as nothing more than a cheat-sheet, a reminder. For proper
    documentation, consult the reference.
    Lawrence D'Oliveiro, Jan 24, 2007
    #13
  14. Adam Cameron

    Adam Cameron Guest

    > I suspect that this is not a common need, given that Subversion is designed
    > to manage entire revisions to sets of files.


    This is actually what I said to my teammate who was asking the question,
    and I furrowed my brow at the notion of moving *part* of the application to
    the live environment. But he had a half-decent reason, so figured I'd look
    into it.

    In the end we just did it by hand.

    --
    Adam
    Adam Cameron, Jan 24, 2007
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wayne
    Replies:
    0
    Views:
    708
    Wayne
    Mar 2, 2004
  2. eddiec
    Replies:
    6
    Views:
    911
    Zenner
    May 20, 2004
  3. c.reifert

    Actually, a wav question instead of mp3 question

    c.reifert, Dec 3, 2004, in forum: Computer Support
    Replies:
    11
    Views:
    843
    °Mike°
    Dec 3, 2004
  4. Jørgen Gilberg
    Replies:
    1
    Views:
    1,021
  5. SPD
    Replies:
    1
    Views:
    1,137
    Jørgen Gilberg
    Aug 13, 2003
Loading...

Share This Page