In ClearCase using commandprompt, how to check whether we have checkedout the latest version of the file?












1















I have a file called prog.c in clearcase, for example the user has checked out this file, say the user has checked out the version 3 of the file.



After that, if some other users checked in the same version of file. say the latest version be 6.



How to check the latest version of the file using the CLEARTOOL command?










share|improve this question





























    1















    I have a file called prog.c in clearcase, for example the user has checked out this file, say the user has checked out the version 3 of the file.



    After that, if some other users checked in the same version of file. say the latest version be 6.



    How to check the latest version of the file using the CLEARTOOL command?










    share|improve this question



























      1












      1








      1


      1






      I have a file called prog.c in clearcase, for example the user has checked out this file, say the user has checked out the version 3 of the file.



      After that, if some other users checked in the same version of file. say the latest version be 6.



      How to check the latest version of the file using the CLEARTOOL command?










      share|improve this question
















      I have a file called prog.c in clearcase, for example the user has checked out this file, say the user has checked out the version 3 of the file.



      After that, if some other users checked in the same version of file. say the latest version be 6.



      How to check the latest version of the file using the CLEARTOOL command?







      clearcase






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 22 '18 at 14:03









      Sneftel

      23.7k64278




      23.7k64278










      asked Mar 5 '13 at 11:35









      rajraj

      7319




      7319
























          1 Answer
          1






          active

          oldest

          votes


















          1














          One way would be a cleartool lsvtree yourFile:

          That would display a textual representation of the version tree, allowing you to see if the version you have is the LATEST on a given branch.



          But one nice trick I sometime use in snapshot view is: 'cleartool co -nc yourFile'.




          • if it works, I cleartool unco immediately.

          • but, if the version isn't the LATEST, the checkout will fail, with a warning asking to update first.


          Note that in a dynamic view, the problem is slightly different: one can checkout (unreserved) while other checkout/check-in.

          You will know you don't have the LATEST version on the checkin stage: it will complain you must merge with the actual latest version in order to create a "new latest" version which will the the result of the combination (merge) of your work and the later versions.





          One way to know where your at, with a checked out version, is to do a:



          cleartool descr -pred -fmt "%Sn" MyFile


          (see "Change set predecessor using cleartool", and "How to list all my check-ins using ClearCase?")



          "%Sn" will give you the branch and version of the file currently checked out.



          You can compare that with:



           cleartool descr -fmt "%Sn" M:aDynamicViewVobpathtomyFile


          If you have a dynamic view with the same config spec and no checkouts, you can use it as "reference view", and see if the branch version in that reference view is the same than the version previous to the one checked out in your local (snap or dyn) view.






          share|improve this answer


























          • Thank you VonC. Yes, the clearcase will pop up while checking in the code. But what happens if more number of file checkout out from clearcase. The user may not aware of the latest versions checked in.

            – raj
            Mar 5 '13 at 12:19











          • I am thinking to write a batch file which should check all the checked out files and it's latest versions. Based on that user will know. This has to be done in a dynamic view. It will be helpful if you provide some suggestions.

            – raj
            Mar 5 '13 at 12:20













          • @raj ok: suggestion added. See my edit.

            – VonC
            Mar 5 '13 at 12:46











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f15222784%2fin-clearcase-using-commandprompt-how-to-check-whether-we-have-checkedout-the-la%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          One way would be a cleartool lsvtree yourFile:

          That would display a textual representation of the version tree, allowing you to see if the version you have is the LATEST on a given branch.



          But one nice trick I sometime use in snapshot view is: 'cleartool co -nc yourFile'.




          • if it works, I cleartool unco immediately.

          • but, if the version isn't the LATEST, the checkout will fail, with a warning asking to update first.


          Note that in a dynamic view, the problem is slightly different: one can checkout (unreserved) while other checkout/check-in.

          You will know you don't have the LATEST version on the checkin stage: it will complain you must merge with the actual latest version in order to create a "new latest" version which will the the result of the combination (merge) of your work and the later versions.





          One way to know where your at, with a checked out version, is to do a:



          cleartool descr -pred -fmt "%Sn" MyFile


          (see "Change set predecessor using cleartool", and "How to list all my check-ins using ClearCase?")



          "%Sn" will give you the branch and version of the file currently checked out.



          You can compare that with:



           cleartool descr -fmt "%Sn" M:aDynamicViewVobpathtomyFile


          If you have a dynamic view with the same config spec and no checkouts, you can use it as "reference view", and see if the branch version in that reference view is the same than the version previous to the one checked out in your local (snap or dyn) view.






          share|improve this answer


























          • Thank you VonC. Yes, the clearcase will pop up while checking in the code. But what happens if more number of file checkout out from clearcase. The user may not aware of the latest versions checked in.

            – raj
            Mar 5 '13 at 12:19











          • I am thinking to write a batch file which should check all the checked out files and it's latest versions. Based on that user will know. This has to be done in a dynamic view. It will be helpful if you provide some suggestions.

            – raj
            Mar 5 '13 at 12:20













          • @raj ok: suggestion added. See my edit.

            – VonC
            Mar 5 '13 at 12:46
















          1














          One way would be a cleartool lsvtree yourFile:

          That would display a textual representation of the version tree, allowing you to see if the version you have is the LATEST on a given branch.



          But one nice trick I sometime use in snapshot view is: 'cleartool co -nc yourFile'.




          • if it works, I cleartool unco immediately.

          • but, if the version isn't the LATEST, the checkout will fail, with a warning asking to update first.


          Note that in a dynamic view, the problem is slightly different: one can checkout (unreserved) while other checkout/check-in.

          You will know you don't have the LATEST version on the checkin stage: it will complain you must merge with the actual latest version in order to create a "new latest" version which will the the result of the combination (merge) of your work and the later versions.





          One way to know where your at, with a checked out version, is to do a:



          cleartool descr -pred -fmt "%Sn" MyFile


          (see "Change set predecessor using cleartool", and "How to list all my check-ins using ClearCase?")



          "%Sn" will give you the branch and version of the file currently checked out.



          You can compare that with:



           cleartool descr -fmt "%Sn" M:aDynamicViewVobpathtomyFile


          If you have a dynamic view with the same config spec and no checkouts, you can use it as "reference view", and see if the branch version in that reference view is the same than the version previous to the one checked out in your local (snap or dyn) view.






          share|improve this answer


























          • Thank you VonC. Yes, the clearcase will pop up while checking in the code. But what happens if more number of file checkout out from clearcase. The user may not aware of the latest versions checked in.

            – raj
            Mar 5 '13 at 12:19











          • I am thinking to write a batch file which should check all the checked out files and it's latest versions. Based on that user will know. This has to be done in a dynamic view. It will be helpful if you provide some suggestions.

            – raj
            Mar 5 '13 at 12:20













          • @raj ok: suggestion added. See my edit.

            – VonC
            Mar 5 '13 at 12:46














          1












          1








          1







          One way would be a cleartool lsvtree yourFile:

          That would display a textual representation of the version tree, allowing you to see if the version you have is the LATEST on a given branch.



          But one nice trick I sometime use in snapshot view is: 'cleartool co -nc yourFile'.




          • if it works, I cleartool unco immediately.

          • but, if the version isn't the LATEST, the checkout will fail, with a warning asking to update first.


          Note that in a dynamic view, the problem is slightly different: one can checkout (unreserved) while other checkout/check-in.

          You will know you don't have the LATEST version on the checkin stage: it will complain you must merge with the actual latest version in order to create a "new latest" version which will the the result of the combination (merge) of your work and the later versions.





          One way to know where your at, with a checked out version, is to do a:



          cleartool descr -pred -fmt "%Sn" MyFile


          (see "Change set predecessor using cleartool", and "How to list all my check-ins using ClearCase?")



          "%Sn" will give you the branch and version of the file currently checked out.



          You can compare that with:



           cleartool descr -fmt "%Sn" M:aDynamicViewVobpathtomyFile


          If you have a dynamic view with the same config spec and no checkouts, you can use it as "reference view", and see if the branch version in that reference view is the same than the version previous to the one checked out in your local (snap or dyn) view.






          share|improve this answer















          One way would be a cleartool lsvtree yourFile:

          That would display a textual representation of the version tree, allowing you to see if the version you have is the LATEST on a given branch.



          But one nice trick I sometime use in snapshot view is: 'cleartool co -nc yourFile'.




          • if it works, I cleartool unco immediately.

          • but, if the version isn't the LATEST, the checkout will fail, with a warning asking to update first.


          Note that in a dynamic view, the problem is slightly different: one can checkout (unreserved) while other checkout/check-in.

          You will know you don't have the LATEST version on the checkin stage: it will complain you must merge with the actual latest version in order to create a "new latest" version which will the the result of the combination (merge) of your work and the later versions.





          One way to know where your at, with a checked out version, is to do a:



          cleartool descr -pred -fmt "%Sn" MyFile


          (see "Change set predecessor using cleartool", and "How to list all my check-ins using ClearCase?")



          "%Sn" will give you the branch and version of the file currently checked out.



          You can compare that with:



           cleartool descr -fmt "%Sn" M:aDynamicViewVobpathtomyFile


          If you have a dynamic view with the same config spec and no checkouts, you can use it as "reference view", and see if the branch version in that reference view is the same than the version previous to the one checked out in your local (snap or dyn) view.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 23 '17 at 10:25









          Community

          11




          11










          answered Mar 5 '13 at 11:51









          VonCVonC

          837k29426463184




          837k29426463184













          • Thank you VonC. Yes, the clearcase will pop up while checking in the code. But what happens if more number of file checkout out from clearcase. The user may not aware of the latest versions checked in.

            – raj
            Mar 5 '13 at 12:19











          • I am thinking to write a batch file which should check all the checked out files and it's latest versions. Based on that user will know. This has to be done in a dynamic view. It will be helpful if you provide some suggestions.

            – raj
            Mar 5 '13 at 12:20













          • @raj ok: suggestion added. See my edit.

            – VonC
            Mar 5 '13 at 12:46



















          • Thank you VonC. Yes, the clearcase will pop up while checking in the code. But what happens if more number of file checkout out from clearcase. The user may not aware of the latest versions checked in.

            – raj
            Mar 5 '13 at 12:19











          • I am thinking to write a batch file which should check all the checked out files and it's latest versions. Based on that user will know. This has to be done in a dynamic view. It will be helpful if you provide some suggestions.

            – raj
            Mar 5 '13 at 12:20













          • @raj ok: suggestion added. See my edit.

            – VonC
            Mar 5 '13 at 12:46

















          Thank you VonC. Yes, the clearcase will pop up while checking in the code. But what happens if more number of file checkout out from clearcase. The user may not aware of the latest versions checked in.

          – raj
          Mar 5 '13 at 12:19





          Thank you VonC. Yes, the clearcase will pop up while checking in the code. But what happens if more number of file checkout out from clearcase. The user may not aware of the latest versions checked in.

          – raj
          Mar 5 '13 at 12:19













          I am thinking to write a batch file which should check all the checked out files and it's latest versions. Based on that user will know. This has to be done in a dynamic view. It will be helpful if you provide some suggestions.

          – raj
          Mar 5 '13 at 12:20







          I am thinking to write a batch file which should check all the checked out files and it's latest versions. Based on that user will know. This has to be done in a dynamic view. It will be helpful if you provide some suggestions.

          – raj
          Mar 5 '13 at 12:20















          @raj ok: suggestion added. See my edit.

          – VonC
          Mar 5 '13 at 12:46





          @raj ok: suggestion added. See my edit.

          – VonC
          Mar 5 '13 at 12:46


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f15222784%2fin-clearcase-using-commandprompt-how-to-check-whether-we-have-checkedout-the-la%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          To store a contact into the json file from server.js file using a class in NodeJS

          Redirect URL with Chrome Remote Debugging Android Devices

          Dieringhausen