Jump to content

command line get specific file with specific changeset


Gerald

Recommended Posts

Hi,

 

I've got two questions regarding the command line:

 

1) Is there any possibility to get all changes (files: added, changed, deleted, moved) for a specific changeset (best way without any local explicit workspace needed)?

 

I want to run a script on a central repo server (after-chekin) which send some change information to our Project management tool (Info: repo, changeset, branch, date, user, commit message, and affected files). Until now I found repo, changeset, branch, date, user, and commit message in the environment variables.

But I did not find any command to find the files that are changed. 

 

2) Is there any possibility to get a specific file with a specific changeset? 

 

like cm cat file.txt#/br:/main#cs:32@rep:Repository@repserver:localhost:8087

 

the cs parameter is currently not implemented, right?

 

 

 

Link to comment
Share on other sites

Hi,

 

1) You will find very useful "cm diff" command:

 

cm diff cs:3@repository@localhost:8084    ( maybe you like more adding "--format={path}" )  More info: "cm diff --help"

 

2) "cm cat --help" command seems that is not updated but you are able to specify a changeset:

 

 cm cat foo.txt#cs:2@rep:default@repserver:localhost:8084

 

Best regards,

Carlos

Link to comment
Share on other sites

1) You will find very useful "cm diff" command:

 

cm diff cs:3@repository@localhost:8084    ( maybe you like more adding "--format={path}" )  More info: "cm diff --help"

 

OK, when I run the command I get the error "Error: There has been an unexpected error "Object reference not set to an instance of an object.". For more information check the server log.

 

I had a look at the server.log

 

 

 

2013-03-21 09:14:30,467  gerald at  INFO  ChannelCall - recb:   761|rect:  0|sentb:   520|sendt: 15|prt:      63|th: 2208|dest:   0|mt:      31|sert:   0|zip:   0|       127.0.0.1|GetRepositoryInfo
2013-03-21 09:14:30,514 00000000-0000-0000-0000-000000000000 gerald at ATANCCTSCM01T INFO  Operations - Get repository info QCReport

2013-03-21 09:14:30,514  gerald at  INFO  ChannelCall - recb:   762|rect:  0|sentb:   514|sendt:  0|prt:       0|th: 2208|dest:   0|mt:       0|sert:   0|zip:   0|       127.0.0.1|GetRepositoryInfo
2013-03-21 09:14:30,514 00000000-0000-0000-0000-000000000000 gerald at ATANCCTSCM01T INFO  Operations - Get info for branch /cs:32 at repository ID 9
2013-03-21 09:14:30,530  gerald at  INFO  ChannelCall - recb:   553|rect:  0|sentb:   293|sendt:  0|prt:      16|th: 2208|dest:   0|mt:      16|sert:   0|zip:   0|       127.0.0.1|GetBranchInfoByName
2013-03-21 09:14:30,577  gerald  at  INFO  ChannelCall - recb:   767|rect:  0|sentb:   615|sendt:  0|prt:      16|th: 2208|dest:   0|mt:      16|sert:   0|zip:   0|       127.0.0.1|GetChangesetInfo
2013-03-21 09:14:30,577  gerald at  INFO  ChannelCall - recb:   767|rect:  0|sentb:   614|sendt:  0|prt:       0|th: 2208|dest:   0|mt:       0|sert:   0|zip:   0|       127.0.0.1|GetChangesetInfo
2013-03-21 09:14:30,592 00000000-0000-0000-0000-000000000000 gerald at ATANCCTSCM01T ERROR Operations - Plastic server version: 4.1.10.391


2013-03-21 09:14:30,592 00000000-0000-0000-0000-000000000000 gerald at ATANCCTSCM01T ERROR Operations - OnError catching exception Object reference not set to an instance of an object.


2013-03-21 09:14:30,592  gerald at  ERROR Codice.CM.Server.ExceptionTracerSink - Dumping in-transit exception:There has been an unexpected error "Object reference not set to an instance of an object.". For more information check the server log.


2013-03-21 09:14:30,608  gerald  at  INFO  ChannelCall - recb:   628|rect:  0|sentb:  1626|sendt:  0|prt:      31|th: 2208|dest:   0|mt:      15|sert:  16|zip:   0|       127.0.0.1|Diff
2013-03-21 09:14:30,639 (null) gerald at (null) INFO  Channel - conn        0 An existing connection was forcibly closed by the remote host

 

 

2) "cm cat --help" command seems that is not updated but you are able to specify a changeset:

 

 cm cat foo.txt#cs:2@rep:default@repserver:localhost:8084

 

 

This works finem thanks. However, if the file wasn't changed in a specific changeset I get an error "The specified revision was not found". But I can handle it.

Link to comment
Share on other sites

On the first question, are you adding some format options or only the basic command? Try only the basic command and tell me if it works(changing repository, repository server and port by yours)

 

cm diff cs:1@rep:default@repserver:localhost:8087

 

Regards,

Carlos

Link to comment
Share on other sites

Can you execute the cm diff ... command with the --stack parameter?

 

Please send us the output and the plastic scm version you are using. Thanks.

 

Strange: the command works now ...

Well, I did some server restarts in the meantime. 

 

Thanks

Link to comment
Share on other sites

  • 2 months later...

I am having some trouble with "cm cat" also.

 

Seems specifying the repository on the end of it has no effect unless the command is run within the workspace and matches the workspace repository :(

 

EG

 

cm cat /maturity/extranet/modules/area/transfer/act_transfer.cfm#cs:7963@default@192.168.16.5:8087

 

"The specified revision was not found /maturity/extranet/modules/area/transfer/act_transfer.cfm#cs:7963@rep:default@192.168.16.5:8087"
 

Eg if I am in the workspace for "default" repository this command works, outside of it it doesn't.

 

Can you please confirm this is a bug in 4.1.10.404 or otherwise show me the error of my ways :P

 

Cheers,

 

TiM

Link to comment
Share on other sites

Hi,

 

I´ve tested the same version and its working fine on both Windows and Linux. Are you indicating the complete path of the file when you are not in the workspace?

 

eg (Windows): cm cat c:\tmp\wks5\foo.txt#cs:2@repo5@localhost:8084

eg (Linux): cm cat /home/tester/Documents/foo.txt#cs:11@default@localhost:8087

 

Regards,

Carlos

Link to comment
Share on other sites

  • 6 months later...

Hi:

 

I'm having trouble with Plastic manual get of files (cat), and every time I do a test, at some point it fails, specially when the test project end in a real project and it get me nervous, because I need to trust in this tool.

 

My version is 5.0.44.505 (client and server)

I'm working on an Interface for Diff and Merge of Visual FoxPro binary files, so lately am doing a bunch of testing and cat command is indispensable for it to work

 

I'm able to do everything with the Plastic IDE, but when it comes to using cat, things doesn't seems to work as expected.

 

post-27781-0-12218100-1387847165_thumb.png

 

As you can see in the image, I've marked 3 changesets: 100, 107 and 110

 

This is the history of the binary file I'm interested (foxbin2prg.pjx), and marked in red the same changesets:

C:\DESA\Plastic>cm history c:\DESA\foxbin2prg\foxbin2prg.pjx
D:06/12/2013 02:16 CS:33  B:/main/v1.9_desa            M:
C:Changeset: 33
D:08/12/2013 15:46 CS:62  B:/main/Conversión de DBF-CDX-DBC M:
C:Changeset: 62 Soporte DBF en desarrollo
D:10/12/2013 00:03 CS:68  B:/main/Conversión de DBF-CDX-DBC M:
C:Changeset: 68 Algunos cambios para soporte DBC
D:11/12/2013 23:29 CS:77  B:/main/Conversión de DBF-CDX-DBC M:
C:Changeset: 77 Soporte DBF mejorado
D:12/12/2013 17:36 CS:80  B:/main/Conversión de DBF-CDX-DBC M:
C:Changeset: 80 Desarrollo ofi DBC
D:15/12/2013 22:45 CS:89  B:/main                      M:
C:Generación EXE v1.14
D:18/12/2013 00:08 CS:96  B:/main                      M:
C:Agregado soporte de conversión de DBFs, DBCs e índices
D:18/12/2013 00:18 CS:97  B:/main                      M:
C:Arreglo de test doBackup
D:18/12/2013 18:52 CS:100 B:/main/v1.15p1              M:
C:Arreglo constante C_ENDWITH
D:18/12/2013 18:58 CS:102 B:/main/Soporte_MNX          M:
C:Inicio soporte MNX
D:19/12/2013 01:22 CS:103 B:/main/Soporte_MNX          M:
C:Arreglo C_ENDWITH
D:20/12/2013 19:09 CS:104 B:/main/Soporte_MNX/Ofi      M:
C:- Terminado DIFF
- Inicio de MERGE
D:20/12/2013 20:44 CS:105 B:/main/Soporte_MNX/Ofi      M:
C:Algunas cosas que se estaban perdiendo
D:21/12/2013 00:30 CS:107 B:/main/Soporte_MNX          M:
C:Arreglo retorno cod estado
D:22/12/2013 20:51 CS:110 B:/main                      M:
C:Generación EXE

When I try to get this file with cm cat it throw an error:

 

C:\DESA\foxbin2prg>cm cat "c:\DESA\foxbin2prg\foxbin2prg.pjt#cs:100" --file="C:\Temp\test.pjt"
The specified revision was not found c:\DESA\foxbin2prg\foxbin2prg.pjt#cs:100

 

The same is with the other two changesets (107 and 110), even writing full repo information it fails. The problem is with Diff and Merge. Even if you can't test Diff and Merge with this binarym you can try to obtain the file with cat, that is what the script tries to do for later conversion to TEXT, but the important thing here is retrieving the files with the information that Diff and Merge configuration have for external tools.

 

This is a small example of Diff LOG for the 3 changesets of the test file:

operacion="DIFF"
sourcefile="C:\Temp\\d2fc2ae4-be23-4773-8f2c-b07c47f4c1c0.pjx"
destinationfile="c:\DESA\foxbin2prg\foxbin2prg.pjx"
sourcesymbolic="cs:110@br:/main fernando"
destinationsymbolic="cs:110@br:/main fernando Workspace Revision"
-----------------------------------------------
operacion="DIFF"
sourcefile="C:\Temp\\f7e32c56-a04e-4458-9061-362df9a3193f.pjx"
destinationfile="C:\Temp\\ba27eb71-7a10-456f-a465-ca62bdf42434.pjx"
sourcesymbolic="rev:c:\DESA\foxbin2prg\foxbin2prg.pjx#cs:107"
destinationsymbolic="rev:c:\DESA\foxbin2prg\foxbin2prg.pjx#cs:110"
-----------------------------------------------
operacion="DIFF"
sourcefile="C:\Temp\\919bfabd-593b-4239-bf54-8c25a2aeb1f2.pjx"
destinationfile="C:\Temp\\dd000115-adac-480e-b3a2-3460ae7d386e.pjx"
sourcesymbolic="rev:c:\DESA\foxbin2prg\foxbin2prg.pjx#cs:97"
destinationsymbolic="rev:c:\DESA\foxbin2prg\foxbin2prg.pjx#cs:100"

And this info is obtained for the Merge:

operacion="MERGE"
sourcefile="C:\Temp\\e8b6b430-15e1-4b8c-99a4-991549e73f39.pjx"
basefile="c:\DESA\foxbin2prg\foxbin2prg.pjx"
destinationfile="c:\DESA\foxbin2prg\foxbin2prg.pjx#/main/Soporte_MNX#cs:107"
sourcesymbolic="c:\DESA\foxbin2prg\foxbin2prg.pjx#/main#cs:110"
basesymbolic="C:\Temp\\b3894431-a073-4ada-8eb9-2f0e80a760b4.pjx"
destinationsymbolic="c:\DESA\foxbin2prg\foxbin2prg.pjx#/main/v1.15p1#cs:100"
output="C:\Temp\\9b139b4b-f99b-443a-9f09-46881abb6be5.pjx"
operacion="DIFF"

So the question is: Why is it failing? Why doesn't work the same way as de IDE?

 

I hope I can resolve this in the next days, because from january 2014 I have to explain to my team how are we going to work with this new SCM and I need to have the tools for Diff and Merge working without error. Cat command must work as expected.

 

 

I've attached my repo with a real (small) project.

 

 

Thanks.

 

 

 

 

 

 

 

fast-export.7z.txt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...