Hi all,

I am a bit surprised by the behavior of "darcs get --tag" and I wonder
if I'm misinterpreting the following statement in the output of "darcs
get --help":

  It is often desiderable to make a copy of a repository that excludes
  some patches. For example, if releases are tagged then `darcs get
  --tag .' would make a copy of the repository as at the latest release.

Does "as at the latest release" actually means "as at the latest
*tagged* release" or effectively "as at the latest *commit*"?

My case is as follows: I have a product on a server, in production,
where I forgot to properly tag the exact version; I made some further
changes in my development branch and when I realized the fact, I went
on the production server and made a tag there, that I subsequently
pulled in my development branch: as expected, doing a "darcs changes"
shows the tag, at the top of all my other changes I recorded.

At this point I wanted to test the exact production version and thus I
tried to "darcs get --tag X" from my *development* branch, but what I
got was actually a copy of the whole development branch, *including*
the changes that are *not* part of the X tag!

I tried with both latest darcs (2.8.1) and a previous version (2.5.2)
with the same result, so the doubt about me doing something wrong...
I'm pretty sure I already did something like that in the past, and it
worked!

I'm attaching a test script that exhibits the unexpected behaviour.
#!/usr/bin/env bash
## Test for issueNNNN - Get --tag does not work
##
## Copyright (C) 2013  Lele Gaifax <l...@metapensiero.it>
##
## Permission is hereby granted, free of charge, to any person
## obtaining a copy of this software and associated documentation
## files (the "Software"), to deal in the Software without
## restriction, including without limitation the rights to use, copy,
## modify, merge, publish, distribute, sublicense, and/or sell copies
## of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
##
## The above copyright notice and this permission notice shall be
## included in all copies or substantial portions of the Software.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
## NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
## BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
## ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
## CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
## SOFTWARE.

. lib                           # Load some portability helpers.

cd /tmp

rm -rf R S T

darcs init      --repo R        # Create our test repos.
darcs init      --repo S

cd R
echo 'Example content.' > test.txt
darcs record -lam 'Add test.txt.'

darcs push ../S -a

echo 'Another example.' >> test.txt
darcs record -am 'Change test.txt.'

cd ..
cd S
darcs tag -m "Tag old revision"

cd ..
cd R
darcs pull -a ../S

cd ..
darcs get --tag "Tag old revision" R T

cd T
test `fgrep -c "Another example." test.txt` -eq 0 || exit 1
test `darcs changes | fgrep "Change test.txt."` -eq 0 || exit 1
Thanks in advance,
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  |                 -- Fortunato Depero, 1929.
_______________________________________________
darcs-users mailing list
darcs-users@darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to