2010-06-08 14 views
68

क्या Mercurial में कोई आदेश है जो वर्तमान में स्रोत नियंत्रण के तहत सभी फ़ाइलों को सूचीबद्ध करेगा?Mercurial (hg) में किसी संग्रह में सभी फ़ाइलों को कैसे सूचीबद्ध करें?

मैं अपने फ़ोल्डर और सबफ़ोल्डर में सभी फ़ाइलों को सूचीबद्ध करने के लिए dir /s कर सकता हूं, लेकिन मुझे नहीं पता कि मेरे भंडार में कौन सा जोड़ा गया है। मेरे पास विभिन्न प्रकार के फ़ाइल प्रकार और फ़ोल्डर्स हैं और मैं यह सत्यापित करना चाहता हूं कि उनमें से कोई भी मुझे अपनी .hgignore फ़ाइल में सेट करने से पहले जोड़ा गया था।

+0

आपको इस पोस्ट को देखना चाहिए: http://mercurial.808500.n3.nabble.com/List-files-in-a-directory-td949176.html#a949176 – Pedro

उत्तर

68

hg status --all पेड़ में सभी फाइलों को सूचीबद्ध करेगा, इसकी स्थिति इंगित करने वाला एक पत्र: संशोधित के लिए एम, स्वच्छ के लिए सी (एचजी के स्वामित्व वाले), और मैं अनदेखा करने के लिए।

केवल के लिए फ़ाइलों को अनदेखा किया गया, hg status -i का उपयोग करें। की फ़ाइलों के लिए अगली प्रतिबद्धता पर जोड़ा गया, hg status -a का उपयोग करें। ये केवल वही दिखाते हैं जिन्हें आपको जानने की आवश्यकता होती है और लंबी फ़ाइल सूची स्कैन करने की आवश्यकता नहीं होती है।

+2

के बाद से अन्य लोगों के जानकारी के लिए यहां लग सकता है, मैंने सोचा था कि मैं अपने नए hglist विस्तार कि मर्क्युरियल देता है एक "ls" कमांड का उल्लेख चाहते हैं: http://alastairs-place.net/projects/hglist/ – alastair

+2

'एचजी सेंट -A' है उपर्युक्त आदेश का संक्षिप्त संस्करण। –

+8

ग्रेट उत्तर, लेकिन यह सीधे सवाल का जवाब नहीं देता है। एक साफ काम करने वाली स्थिति के साथ, 'एचजी स्थिति-सी' सभी ट्रैक की गई फाइलों और केवल ट्रैक की गई फाइलों को सूचीबद्ध करता है। अन्य परिवर्तनों के साथ, 'एचजी स्थिति -कर्मड' चाल करेगा। स्थिति ध्वज को बाहर करने के लिए '-n' जोड़ें। – undefined

19

hg manifest केवल भंडार में फ़ाइलों को सूचीबद्ध करेगा, जबकि hg status --all भंडार की संरचना में सभी फ़ाइलों को सूचीबद्ध करेगा और एक मार्कर शामिल करेगा जिसके लिए ट्रैक किया जा रहा है और जो नहीं हैं।

+1

यह मुझे वही देता है जो मैं चाहता था, मामूली नुकसान होने के बावजूद कि इसे ओपी की तरह फ़ोल्डर द्वारा संकुचित नहीं किया जा सकता है। यह स्वीकार्य उत्तर से अभी भी बेहतर है। –

-4
 
C:\>hg help -v status 
hg status [OPTION]... [FILE]... 

aliases: st 

show changed files in the working directory 

    Show status of files in the repository. If names are given, only files 
    that match are shown. Files that are clean or ignored or the source of a 
    copy/move operation, are not listed unless -c/--clean, -i/--ignored, 
    -C/--copies or -A/--all are given. Unless options described with "show 
    only ..." are given, the options -mardu are used. 

    Option -q/--quiet hides untracked (unknown and ignored) files unless 
    explicitly requested with -u/--unknown or -i/--ignored. 

    NOTE: status may appear to disagree with diff if permissions have changed 
    or a merge has occurred. The standard diff format does not report 
    permission changes and diff only reports changes relative to one merge 
    parent. 

    If one revision is given, it is used as the base revision. If two 
    revisions are given, the differences between them are shown. The --change 
    option can also be used as a shortcut to list the changed files of a 
    revision from its first parent. 

    The codes used to show the status of files are: 

     M = modified 
     A = added 
     R = removed 
     C = clean 
     ! = missing (deleted by non-hg command, but still tracked) 
     ? = not tracked 
     I = ignored 
     = origin of the previous file listed as A (added) 

options: 

-A --all    show status of all files 
-m --modified  show only modified files 
-a --added   show only added files 
-r --removed   show only removed files 
-d --deleted   show only deleted (but tracked) files 
-c --clean   show only files without changes 
-u --unknown   show only unknown (not tracked) files 
-i --ignored   show only ignored files 
-n --no-status  hide status prefix 
-C --copies   show source of copied files 
-0 --print0   end filenames with NUL, for use with xargs 
    --rev    show difference from revision 
    --change   list the changed files of a revision 
-I --include   include names matching the given patterns 
-X --exclude   exclude names matching the given patterns 

global options: 
-R --repository  repository root directory or name of overlay bundle file 
    --cwd    change working directory 
-y --noninteractive do not prompt, assume 'yes' for any required answers 
-q --quiet   suppress output 
-v --verbose   enable additional output 
    --config   set/override config option (use 'section.name=value') 
    --debug   enable debugging output 
    --debugger  start debugger 
    --encoding  set the charset encoding (default: cp1252) 
    --encodingmode set the charset encoding mode (default: strict) 
    --traceback  always print a traceback on exception 
    --time   time how long the command takes 
    --profile   print command execution profile 
    --version   output version information and exit 
-h --help   display help and exit 
+4

अजीब बात है। लेकिन क्या वास्तव में लोगों को मैनुअल पढ़ने के लिए यह कहना बुरा है? क्या स्टैकओवरफ्लो दस्तावेज़ को अमान्य कर दिया था? लोगों का उपयोग कर '--help' /' /? '/' man' और अन्य दस्तावेज़ क्योंकि इसे पढ़ने के लिए की तुलना में stackoverflow पर पूछने के लिए जल्दी है बंद कर दिया है? मैं अपने जवाब :) – simendsjo

+0

हे दूर करने के लिए मना कर दिया, ठीक है, आप एक वोट अप मेरे लिए, के रूप में यह सबसे अधिक उपयोगी जवाब यहाँ है हो सकता है। मैं मैं क्या इसे से पता चला है के आधार पर एक दूसरे से नहीं लिख सकते हैं और अगर मैं क्या इसके लायक है, आपका जवाब बहुत अच्छा है के लिए किसी भी upvotes :-) – Benjohn

+1

मिल देखेंगे। लेकिन किसी उपयोगकर्ता को यह पता होना चाहिए कि 'स्थिति', क्योंकि 'hg' आदेशों में से एक वास्तव में इसे पहले स्थान पर करेगा। मैं हर दिन Mercurial का उपयोग करता हूं और मुझे नहीं पता था कि इसे अनदेखा फाइलों को दिखाने के लिए कहा जा सकता है। – Benjohn

57

आप hg locate कमांड भी देख सकते हैं। जब मैं फ़ाइलों को किसी निश्चित निर्देशिका में सीमित करना चाहता हूं, तो मैं -I विकल्प के साथ इसका उपयोग करता हूं।

अपने भंडार में सभी फाइलों को सूचीबद्ध करने के लिए:

hg locate 

भंडार से ("रूट") निर्देशिका:

hg locate -I dir/sub_dir/dir_of_interest 

पथ -I आवश्यकताओं के पारित कर दिया निर्देशिका के आधार पर बदल जाते हैं जिसमें आप कमांड चलाते हैं। एक ही रहेगा, भंडार में प्रत्येक फ़ाइल का पूरा रास्ता दिखा

hg locate -I sub_dir/dir_of_interest 

उत्पादन फ़ाइलों की सूची: यदि आप ऊपर के उदाहरण में dir निर्देशिका से आदेश चला, तो आप अपने तर्क को संशोधित करने का पता लगाने की आवश्यकता होगी ।

अधिक जानकारी के लिए hg help -v locate आज़माएं।

+2

बस मुझे क्या चाहिए, धन्यवाद। यह किसी ऐसे व्यक्ति के लिए बेहतर उत्तर है जिसे ट्रैक की गई फ़ाइलों को सूचीबद्ध करने की आवश्यकता है। –

+1

'hg loc' उपर्युक्त आदेश का संक्षिप्त संस्करण है। –

+3

यह वास्तविक जवाब है। नेड का जवाब एक गैर स्टार्टर है। –

3

केवल ध्यान नहीं दिया गया लिस्टिंग या जोड़ा फ़ाइलें

केवलनजरअंदाज कर दिया फ़ाइलों की सूची के लिए, कार्य करें: hg status -i

केवल फ़ाइलों को जोड़ा गया, hg status -a करें।

यदि आपको अधिक टाइपिंग पसंद नहीं है, तो आप इन्हें hg sta -i और hg sta -a पर छोटा कर सकते हैं।

status के दो उपयोग locate से अधिक सरल हैं और आपको विशिष्ट फाइलें बताएंगी जिनके बारे में आप चिंतित हैं, इसलिए यह काफी कम त्रुटि प्रवण है।hg status

के बारे में

अधिक अस्थिर रेपो में सभी फाइलों को सूचीबद्ध करने के कार्य करें: hg status --all

फ़ाइलों से पहले उन्हें एक उपसर्ग दिया जाएगा, जब वे सूचीबद्ध हैं:

    :

    M = modified 
        A = added 
        R = removed 
        C = clean 
        ! = missing (deleted by non-hg command, but still tracked) 
        ? = not tracked 
        I = ignored 
    

    आप एक फ़ोल्डर में केवल फाइलों की सूची बनाना चाहते हैं, तो आप एक मार्ग प्रदान कर सकते हैं

  • hg st --all MyFolder - MyFolder
  • में सभी फाइलों
  • hg sta -i MyFolder - MyFolder में सिर्फ नजरअंदाज कर दिया फ़ाइलों।

साथ ही "अनदेखा" और के लिए "जोड़ा गया" -a के लिए -i, अन्य झंडे केवल एक विशेष स्थिति बनी फ़ाइलों की सूची के लिए उपलब्ध हैं।

status आदेश के लिए एक व्यापक व्याख्या के लिए हो रही है help

पढ़ें the other very useful answer here। यह वोट नीचे है, क्योंकि लेखक आप मर्क्युरियल पूछ status आदेश इस तरह के बारे में द्वारा ऊपर के सभी खोज कर सकते हैं कि दिखाने की कोशिश की है:

hg help status 

आप मर्क्युरियल पूछ सकते हैं इसके किसी भी बारे में बताने के आदेशों है इस तरह। और यदि आप Mercurial के आदेशों की एक सूची चाहते हैं, तो hg help टाइप करें।

संबंधित मुद्दे